Complete snapshot of /opt/microdao-daarion/ from NODE1 (144.76.224.179).
This represents the actual running production code that has diverged
significantly from the previous main branch.
Key changes from old main:
- Gateway (http_api.py): expanded from ~40KB to 164KB with full agent support
- Router: new /v1/agents/{id}/infer endpoint with vision + DeepSeek routing
- Behavior Policy: SOWA v2.2 (3-level: FULL/ACK/SILENT)
- Agent Registry: config/agent_registry.yml as single source of truth
- 13 agents configured (was 3)
- Memory service integration
- CrewAI teams and roles
Excluded from snapshot: venv/, .env, data/, backups, .tgz archives
Co-authored-by: Cursor <cursoragent@cursor.com>
8.7 KiB
8.7 KiB
DAARION Architecture Diagram
Production-Grade Stack with Event Bus
┌──────────────────────────────┐
│ MONITORING │
│ Prometheus :9090 Grafana:3030│
│ Alerts + Queue Lag │
└───────────────┬──────────────┘
│ metrics/logs/alerts
│
┌───────────────────────────────────────┴──────────────────────────────────┐
│ CONTROL PLANE │
│ │
│ Control Plane :9200 │
│ ├── /prompts/{agent_id} — versioned system prompts │
│ ├── /policy/{agent_id} — RBAC, entitlements, modes │
│ ├── /config/{key} — routing rules, feature flags │
│ └── /quotas/{user_id} — rate limits, budgets │
│ │
└───────────────────────────────────────┬──────────────────────────────────┘
│ policy/config fetch (cached)
│
┌───────────────────────────────────────┴──────────────────────────────────┐
│ DATA PLANE │
│ │
│ Gateway (BFF) :9300 │
│ ├── Telegram webhooks │
│ ├── Auth, sessions, throttling │
│ └── Request normalization │
│ │ │
│ ▼ │
│ Router :9102 │
│ ├── Agent routing │
│ ├── Tool orchestration │
│ ├── Policy enforcement │
│ └── LLM calls (DeepSeek/Mistral/Grok/Ollama) │
│ │ │
│ ▼ │
│ Swapper (GPU) :8890 │
│ ├── Vision (qwen3-vl) │
│ ├── STT (faster-whisper) │
│ ├── TTS (edge-tts) │
│ └── Image Gen (FLUX lazy) │
│ │
│ Ingest :8100 ──► [NATS: attachment.created] │
│ Parser :8101 ◄── [NATS: attachment.created] ──► [attachment.parsed] │
│ │
└──────────────────────────────────────────────────────────────────────────┘
│
┌───────────────────────────────────────┴──────────────────────────────────┐
│ ORCHESTRATION / JOBS │
│ │
│ CrewAI :9010 CrewAI Worker :9011 │
│ ├── Agent definitions ├── [NATS: agent.run.requested] │
│ └── Crew management └── [NATS: agent.run.completed] │
│ │
└──────────────────────────────────────────────────────────────────────────┘
│
┌───────────────────────────────────────┴──────────────────────────────────┐
│ DATA LAYER │
│ │
│ Memory API :8000 ◄─── ЕДИНСТВЕННАЯ ТОЧКА ДОСТУПА К ДАНИМ │
│ │ │
│ ├──► PostgreSQL :5432 (facts, sessions, quotas, audit) │
│ ├──► Qdrant :6333 (vectors: messages, docs, artifacts) │
│ ├──► Neo4j :7687 (graph: users, topics, relations) │
│ └──► Redis :6379 (cache, sessions) │
│ │
└──────────────────────────────────────────────────────────────────────────┘
┌──────────────────────────────────────────────────────────────────────────┐
│ EVENT BUS (CROSS-CUTTING) │
│ │
│ NATS JetStream :4222 │
│ │
│ Streams: │
│ ├── MESSAGES (message.received/processed/sent) │
│ ├── ATTACHMENTS (attachment.created/parsed/indexed) │
│ ├── AGENT_RUNS (agent.run.requested/completed/failed) │
│ ├── MEMORY (memory.store/indexed) │
│ └── AUDIT (audit.action/error, ops.health/alert) │
│ │
│ Consumers: │
│ ├── parser-pipeline (attachment.created.>) │
│ ├── crewai-worker (agent.run.requested) │
│ ├── memory-indexer (memory.store.>) │
│ └── audit-logger (audit.>) │
│ │
└──────────────────────────────────────────────────────────────────────────┘
Key Principles
- NATS is cross-cutting — connects all layers, not just bottom
- Control Plane — policy/config separate from data plane
- Memory API — single access point to all data stores
- Async by default — Parser, Workers via NATS
- Observability — metrics + logs + trace_id everywhere