Hierarchical agent orchestration with session encryption and distributed support. Agents call other agents as tools, forming execution trees.
The following shows an example agent workflow, which should be easily adaptable to other use cases. More complex workflows can be created by increasing the depth of the agent tree. It is generally recommended to increase depth rather than breadth to avoid overwhelming models with too many tools. Note that not all tools need to be agents.
graph TD
User[User Request] --> API[FastAPI Endpoint]
API --> Session[Session Manager]
Session --> EncryptLayer[Encrypted Session<br/>Fernet + HKDF]
EncryptLayer --> SQLite[(SQLite<br/>Local Storage)]
EncryptLayer --> Postgres[(PostgreSQL<br/>Distributed)]
Session --> Orch[Orchestrator Agent<br/>Claude 3.5 Sonnet]
Orch --> Tool1[translate_to_spanish<br/>Tool Function]
Orch --> Tool2[translate_to_french<br/>Tool Function]
Orch --> Tool3[translate_to_italian<br/>Tool Function]
Orch --> Search[web_search<br/>Tavily API]
Tool1 --> Spanish[Spanish Agent<br/>GPT-4o-mini]
Tool2 --> French[French Agent<br/>GPT-4o-mini]
Tool3 --> Italian[Italian Agent<br/>GPT-4o-mini]
Italian --> Tool4[get_travel_advise<br/>Tool Function]
Spanish --> Weather[get_weather_forecast<br/>Tool Function]
Tool4 --> Travel[Italian Travel Agent<br/>Llama 3.1]
- Agent Trees: Agents wrapped as async tools, enabling nested agent calls
- Session Encryption: Fernet encryption with per-session derived keys and TTL
- Distributed Mode: PostgreSQL backend for multi-instance deployments
- Model Flexibility: Mix models from different providers (OpenRouter compatible)
- Web Search: Integrated Tavily search for real-time information
- FastAPI: Production-ready REST endpoints with health checks
Key environment variables:
KEY: OpenRouter API keyENCRYPTION_KEY: Fernet key for session encryptionUSE_DISTRIBUTED: Enable PostgreSQL backendDATABASE_URL: PostgreSQL connection stringLOG_LEVEL: Control logging verbosity
See .env.example for all options.