Layered architecture for long-horizon memory, retrieval, and learning.
Context view shows boundaries. Container view shows responsibilities and protocol flow. Runtime view shows execution order.
Quick Path
How to read this architecture set
- Start with System Context (C4 Level 1) to understand boundaries and external dependencies.
- Use Service Map to see the single ingress orchestrator and subsystem relationships.
- Review Write + Retrieval Flows for runtime movement of data and learning feedback.
- Finish with Task Coordination + Ops for agent orchestration, messaging surfaces, and reliability controls.
C4 Level 1
System Context View
Context view keeps boundary and interaction semantics clear before implementation detail.
Legend + Roles
What each context block means
- [A] External Actors: clients submitting memory writes and search requests.
- [B] Orchestrator: single control plane for ingress, auth, validation, and routing.
- [C] Memory Plane: durable stores used for fanout and retrieval synthesis.
- [D] Ops + Safety: reliability controls for queue, storage, and policy.
- [E] Task Coordination + Agent Communication: orchestrator-managed task routing for internal/external agents plus messaging ingress/egress.
- [F] Dependencies: pluggable model/tool providers and optional cloud BYO services.
C4 Level 2
Service and Flow Views
Container Notes
How to read these diagrams quickly
- Panel 1 (Service Map): where each subsystem lives and who depends on it.
- Panel 2 (Write Flow): how writes move from ingress to durable fanout sinks.
- Panel 3 (Retrieval Flow): how recall/rerank returns context and captures learning signals.
- Panel 4 (Task Coordination): how the orchestrator plans tasks, fans out workers, and communicates through messaging channels.
- HTTP-first ingress: orchestrator remains the single write/search entrypoint.
- Messaging surfaces: can operate bidirectionally (human ingress + response egress).
- Local-first default: local stores first, cloud BYO remains optional.
Runtime Ownership
Which language runs what, and why
Python: compact hooks and development utilities
- Runs: bounded hook glue and optional repo-local development scripts, not an application service.
- Why: keeps portable lifecycle hooks and one-shot tooling lightweight without owning live routes.
- Boundary: no Python process or fallback ingress is launched by the active public runtime.
Rust: memory and retrieval hot path
- Runs: codec, memory engine, retrieval engine, and staged retrieval proxy paths.
- Why: lower-latency execution, predictable memory behavior, and safer high-throughput concurrency.
- Efficacy impact: smaller p95/p99 tails and better retrieval throughput under sustained load.
Go: ingress and orchestration services
- Runs: primary external ingress on
:8075, staged retrieval policy, scheduler/gateway services, batching, retries, and backpressure control. - Why: efficient long-running service concurrency and operational simplicity for scheduling workloads.
- Efficacy impact: lower user-visible latency with more predictable tail behavior.
Current Runtime Default
Rust+Go own the active application runtime
- Default posture: Rust+Go runtime path is enabled for performance-critical execution.
- Ownership posture: strict native-route audits reject accidental Python hot-path ownership.
- Verification endpoint: query
GET /migration/runtimeto confirm active runtime mode. - Efficacy focus: optimize for correct outcomes per request, not raw benchmark numbers alone.
Release Boundaries
Public operator modes
Lite default
- Primary interface: CLI workflows for agents and operators
- Ingress:
gateway-goon:8075 - Runtime boundary: no Python service is launched; hook glue remains outside the application path
- Fast memory: topic rollups, Qdrant, graph neighbors, and bounded context packs
- Slow-source handling: async continuation by default for tail-latency control
- Objective: stable local memory with clear operational behavior
Optional adapter lab
- Mode:
gmake mem-up-lite-advanced - Purpose: public, opt-in adapter testing without changing quickstart defaults
- Boundary: not a paid/private lane and not automatic promotion
- Proof: use runner-quality, recall quality, and live operator checks before adopting a lane
- Objective: make experimentation observable without surprising normal users
Runtime lane flow
flowchart TD
A["Caller"] --> B["gateway-go :8075"]
B --> C["Rust retrieval + staged policy"]
C --> D["Fast default: topic_rollups, qdrant"]
C --> E["Slow async: mindsdb, mongo_raw, letta, memory_bank"]
E --> F["Continuation events + cache warm"]
B --> G["Strict native ownership audit"]
B --> H["Optional adapter lab"]
H --> I["Bounded telemetry + operator review"]
I --> J["Promote only with hard gate evidence"]
Dynamic View: Write Flow
Write Flow
Order of operations
- Authenticate and normalize write payload.
- Persist raw event for replay durability.
- Append async outbox fanout jobs.
- Dispatch sink writes with retries/backpressure.
- Record queue and sink telemetry.
Dynamic View: Retrieval Flow
Retrieval Flow
Order of operations
- Receive scoped query (project/topic aware).
- Run parallel retrieval across sinks.
- Merge and rank candidates for retrieval egress.
- Prompt for context-quality feedback when useful.
- Write feedback signals to improve future ranking.
Dynamic View: Agent Coordination
Session Package Flow
Order of operations
- Bootstrap a typed agent session for the active profile and project.
- Attach checkpoints, handoffs, source coverage, and risk signals during work.
- Compute a rollup with objective state, confidence, and missing evidence.
- Emit a bounded context package before the next hard model call.
- Preserve contract metadata so CLI, HTTP, MCP, and dashboard surfaces agree.
Ops + Safety
Controls that keep long-horizon operation stable
- Queue durability: retries, deadletters, and replay workflows.
- Write pressure management: backpressure + coalescing under burst load.
- Storage hygiene: retention sweeps and external cold-path handoff.
- Security posture: strict API-key auth and secrets redaction/block controls.
- Operational confidence: health probes, telemetry, and update automation.