Tools

Tools

Tools let your agent call custom functions during a conversation (for example: rag, lookups, scheduling, database queries..etc).

In SIPHON, you add tools by passing tool mixin classes to Agent(tools=[...]).

How to define a tool

Use the tool decorator from SIPHON:

  • from siphon.agent import tool

Each tool is typically an async def method.

Example

from siphon.agent import Agent, tool

class CustomerTools:
    @tool
    async def lookup_order(self, order_id: str) -> str:
        """Lookup a customer order by id."""
        return f"Order {order_id} is confirmed."

agent = Agent(
    agent_name="Receptionist",
    tools=[CustomerTools],
)

if __name__ == "__main__":
    agent.dev()

Notes

  • Tools are passed as classes (mixins), not instances.
  • Keep tools focused and safe (network calls, DB calls, etc. should have timeouts and error handling).