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>
2.3 KiB
2.3 KiB
Memory API — Single Access Point Policy
Rule: All data access ONLY through Memory API :8000
Allowed
Router ──► Memory API ──► Qdrant/Neo4j/Postgres
Parser ──► Memory API ──► Qdrant
Gateway ──► Memory API ──► facts/sessions
CrewAI ──► Memory API ──► context retrieval
Forbidden (direct DB access)
Router ──✗──► Qdrant (direct)
Parser ──✗──► Neo4j (direct)
Swapper ──✗──► Postgres (direct)
Exceptions
- Migrations — admin scripts only
- Backups — scheduled jobs
- Health checks — read-only probes
Memory API Endpoints
| Endpoint | Purpose | Consumers |
|---|---|---|
| POST /retrieve | Vector + graph search | Router |
| POST /store | Save message/document | Router, Parser |
| POST /artifacts/store | RAG document indexing | Parser |
| GET /facts/{key} | Get user facts | Gateway |
| POST /facts/upsert | Update user facts | Gateway |
| POST /agents/{id}/memory | Agent-scoped storage | Gateway |
Benefits
- Unified ACL — one place for access control
- Privacy enforcement — mode/confidential checks
- Audit trail — all access logged
- Schema consistency — Memory API validates
- Easy migration — change DB without touching services
Enforcement
Network Level (Docker)
# Only Memory API can reach DBs
services:
qdrant:
networks:
- data-internal # Not exposed to dagi-network
memory-service:
networks:
- data-internal
- dagi-network # Exposed to services
Code Level
- Router: use ToolManager with Memory API calls
- Parser: use Memory API for indexing
- No direct Qdrant/Neo4j imports in Router/Parser
Migration Plan
- ✅ Router already uses Memory API via tool_manager
- ✅ Parser uses Memory API for indexing
- ⏳ Audit all direct DB connections
- ⏳ Move to internal network for DBs
Tech Debt: Router Direct Neo4j Access
Current state: Router has direct Neo4j access for graph_query tool.
Why: Performance optimization for real-time graph traversal.
Plan:
- Add
/graph/queryendpoint to Memory API - Migrate Router to use Memory API
- Remove direct Neo4j driver from Router
Priority: Medium (after MVP stabilization)