Architecture

Last updated 25 Jan 2026, 13:49

Core Components

  • API: persistence + orchestration of Projects and Tasks.
  • Queue: Redis + RQ with three queues: high/default/low chosen by priority.
  • Worker: executes agent jobs, writes results back via RQ result or pushes to API in future versions.
  • FS Sandbox: agents can only read/write within FS_SANDBOX_ROOT if task allow_fs=True.
  • Human tasks: claimed and completed via API; web UI (stub) will list and allow action.
  • Knowledge Brain: Unified memory system with hybrid search, conversation memory, and decision tracking. See KNOWLEDGE_BRAIN.md for full documentation.

Knowledge Brain v2.0

The Knowledge Brain is Zenpower's state-of-the-art unified knowledge system:

Component Technology Purpose
Vector Search pgvector + HNSW Semantic similarity
Full-Text Search PostgreSQL FTS + GIN Keyword matching
Graph Search Entity relationships Multi-hop reasoning
Memory Hierarchy MemGPT-style 4-tier Infinite context
Reranking ColBERT late-interaction Precision improvement
Summarization RAPTOR trees Multi-level abstraction

Performance Targets:

  • 100+ QPS, <50ms p95 latency
  • 20% accuracy improvement on complex queries
  • Military-grade access control and audit trails

Data model (MVP)

  • Project(id, name, description, created_at)
  • Task(id, project_id, title, type, status, priority, assignee, payload, result, depends_on[], allow_fs)

Extensibility

  • Add worker job modules under apps/worker/jobs/*.py and reference the function name in payload.job (e.g., "agent_echo").
  • Add auth, RBAC, audit logs for production.