Architecture Overview
Understanding the Crella.ai system architecture.
High-Level Architecture
flowchart TB
subgraph clients [Client Layer]
Web[Web Apps]
API[API Clients]
Mobile[Mobile Apps]
end
subgraph gateway [Gateway Layer]
LB[Load Balancer]
Auth[Authentication]
Rate[Rate Limiter]
end
subgraph orchestration [Orchestration Layer]
Lima[Lima Orchestrator]
Queue[Task Queue]
State[State Manager]
end
subgraph agents [Agent Layer]
Alpha[Alpha]
Bravo[Bravo]
Charlie[Charlie]
Delta[Delta]
Echo[Echo]
Foxtrot[Foxtrot]
Golf[Golf]
Hotel[Hotel]
India[India]
Juliet[Juliet]
Kilo[Kilo]
end
subgraph human [Human Layer]
Arena[Crella Arena]
Staff[Human Operators]
end
subgraph storage [Storage Layer]
DB[(Database)]
Cache[(Redis)]
Files[(File Storage)]
end
clients --> gateway
gateway --> orchestration
orchestration --> agents
orchestration --> human
agents --> storage
human --> storage
Component Overview
1. Client Layer
- Web Applications: React/Next.js frontends
- API Clients: REST/GraphQL integration
- Mobile Apps: React Native (planned)
2. Gateway Layer
- Load Balancer: Nginx reverse proxy
- Authentication: JWT + API keys
- Rate Limiter: Per-client throttling
3. Orchestration Layer
Lima (The Orchestrator) is the brain of the system:
flowchart LR
Input[Task Input] --> Lima
Lima --> Route{Route Decision}
Route -->|Automated| Agent[AI Agent]
Route -->|Complex| Human[Human Review]
Route -->|Hybrid| Both[Both]
Agent --> Output[Task Output]
Human --> Output
Both --> Output
Key responsibilities:
- Task classification
- Agent selection
- Workflow orchestration
- Error recovery
- State management
4. Agent Layer
The 12 BPO agents operate in specialized pipelines:
Intake Pipeline
flowchart LR
Raw[Raw Data] --> Alpha[Alpha - Validate]
Alpha --> Bravo[Bravo - Triage]
Bravo --> Next[Next Stage]
Processing Pipeline
flowchart LR
Doc[Document] --> Charlie[Charlie - Extract]
Charlie --> Delta[Delta - Decide]
Delta --> Result[Decision]
Enrichment Pipeline
flowchart LR
Lead[Lead Data] --> Echo[Echo - Research]
Echo --> Foxtrot[Foxtrot - Content]
Foxtrot --> Hotel[Hotel - Send]
5. Human Layer
The Crella Arena provides:
- Task escalation handling
- Quality assurance
- Complex decision support
- Relationship management
6. Storage Layer
| Component | Technology | Purpose |
|---|---|---|
| Database | PostgreSQL/SQLite | Structured data |
| Cache | Redis | Session, rate limiting |
| Files | S3/Local | Documents, media |
| Search | Elasticsearch | Full-text search |
Data Flow Example
Lead Processing Workflow
sequenceDiagram
participant Client
participant Lima
participant Alpha
participant Echo
participant Foxtrot
participant Hotel
participant Client
Client->>Lima: Submit Lead
Lima->>Alpha: Validate Data
Alpha-->>Lima: Validated Lead
Lima->>Echo: Enrich Lead
Echo-->>Lima: Enriched Data
Lima->>Foxtrot: Generate Email
Foxtrot-->>Lima: Email Content
Lima->>Hotel: Send Email
Hotel-->>Lima: Delivery Status
Lima-->>Client: Task Complete
Scaling Strategy
Horizontal Scaling
- Each agent can run multiple instances
- Lima coordinates work distribution
- Stateless design enables easy scaling
Vertical Specialization
- Agents can be fine-tuned per client
- Custom training for specific domains
- Specialized pipelines for industries
Security Architecture
flowchart TB
subgraph external [External]
User[User]
API[API Client]
end
subgraph perimeter [Perimeter]
WAF[Web Application Firewall]
CDN[Cloudflare CDN]
end
subgraph auth [Authentication]
JWT[JWT Validation]
RBAC[Role-Based Access]
end
subgraph internal [Internal Network]
Services[Crella Services]
Agents[AI Agents]
end
external --> perimeter
perimeter --> auth
auth --> internal
Technology Stack
| Layer | Technologies |
|---|---|
| Frontend | Next.js, React, Tailwind CSS |
| Backend | Node.js, TypeScript, Python |
| AI/ML | Claude, GPT-4, Rasa, Ollama |
| Database | PostgreSQL, SQLite, Redis |
| Infrastructure | PM2, Nginx, Docker |
| Monitoring | Prometheus, Grafana |
Next Steps
- 12-Agent System — Detailed agent documentation
- API Overview — Integration guide
- Deployment — Self-hosting guide