How elokus/whatsappagent works
Main Components
a) Client Layer:
• Command Line Interface
• Future WhatsApp Webhook Integration (mentioned in README)
b) Application Core:
• Message Service (Central Coordinator)
• Agent System
• Tools System
• Database Layer
Detailed Component Breakdown
a) Domain Layer (Core Business Logic):
• Agent System:
• Routing Agent (Controller)
• Task Agent
• Demo Agent
• Base Agent (Abstract)
• Tools System:
• Query Tool
• Tool
• Report Tool
• Base Tool (Abstract)
b) Infrastructure Layer:
• LLM Service (OpenAI Integration)
c) Persistence Layer:
• Database Connection
• Data Models
• Mock Data Service
Component Relationships
Key interactions:
User Input → Message Service → Routing Agent → Task/Demo Agent → Tools → Database
• ↑
• LLM Service (OpenAI)
Technical Details
• Python/Pydantic as the core framework
• OpenAI API integration
• Database connection
• Environment configuration
Persistence Layer (Bottom)
This system design should capture the essence of a domain-driven design architecture with clear separation between domain logic, infrastructure, and persistence layers, while highlighting the unique aspects of the AI agent routing system and its interaction with external services.
Remember to maintain a balance between showing enough detail to understand the system's architecture while keeping it clean and readable. The focus should be on the interaction between the routing agent, task agents, and their tools, as this appears to be the core functionality of the system.