System Architecture
The system follows a hexagonal (ports and adapters) architecture with clear separation between:
1. Entities (Core Domain)​
The business objects and logic at the core of the application:
- Brain, Agent, Chat, Message, Flow, etc.
2. Adapters​
Driven Adapters (Secondary/Output Adapters)​
Connect the application to external systems:
- Chat Adapters: OpenAI, LlamaCPP
- Storage Adapters: MongoDB, Google Cloud Storage, MinIO
- Guardian Adapters: LLMGuards, OpenAI moderation
- Vector Store Adapters: Weaviate
Driving Adapters (Primary/Input Adapters)​
Connect the application to users/clients:
- API: Koa.js REST API with routes for all functionality
- WebSockets: Real-time communication for streaming responses