[User / API client] ──objective──► [AAROP Platform] ──results+trace──► [User]
│
┌──────────────┼───────────────┐
▼ ▼ ▼
[Model Providers] [Tool Sandboxes] [Memory/Vector Store]
┌─────────────────────────────────────────────────────────────┐
│ API Gateway (auth, rate-limit, budget, schema validation) │
└───────────────┬─────────────────────────────────────────────┘
▼
┌───────────────┐ ┌────────────────────┐
│ Orchestrator │◄──────►│ Workflow Engine │
│ (Agentic Loop)│ │ (Temporal / sagas) │
└──┬─────┬──────┘ └────────────────────┘
│ │
┌──────┘ └──────┐
▼ ▼
[Worker Agents] [Tool Registry] [Memory Service] [Model Router]
│ │ │ │
└──────────────┬────┴──────────────────┴─────────────────┘
▼
[Observability + Eval + FinOps]
Client → Orchestrator: run(objective, budget)
Orchestrator → Memory: recall(objective) # PERCEIVE
Orchestrator → Planner: plan(objective, ctx) # PLAN (cost metered)
loop until accepted | budget exhausted:
Orchestrator → Actor → ToolRegistry: call(tool, args) # ACT (validated, sandboxed)
Orchestrator: detect anomaly # OBSERVE
Orchestrator → Verifier: verify(objective, scratchpad) # REFLECT
alt accepted:
Orchestrator → Memory: commit(result) # DONE
else:
Orchestrator: replan / retry / escalate # ADAPT
Orchestrator → Client: state.checkpoint() + trace
| Concern | Demo (this repo) | Production |
|---|---|---|
| Loop durability | in-process state machine | Temporal durable workflow + checkpoints |
| Model backend | MockProvider |
OpenAI/Anthropic + self-hosted vLLM/Ollama |
| Memory / RAG | in-memory bag-of-words | pgvector / Qdrant + BM25 + cross-encoder reranker |
| State store | Python dataclass | Postgres + Redis (working memory) |
| Tool sandbox | charset-restricted eval | gVisor / seccomp containers |
| Tracing | in-memory event buffer | OpenTelemetry + Langfuse/Phoenix |
| Serving | CLI | FastAPI + Celery/Arq workers, gRPC A2A |
| Infra | none | Docker + K8s + Helm + Terraform, KEDA autoscaling |
Context: Prompt-chained agents are opaque and hard to debug/recover.
Decision: Model Perceive→…→Adapt as enumerated phases with logged transitions.
Consequences: +observability, +replay, +crash recovery; −slightly more boilerplate. Accepted.
Context: Agents can loop forever or blow up cost.
Decision: Every run carries max_steps/max_cost/max_seconds; exceeding → escalate.
Consequences: predictable cost & latency; safe failure mode (human escalation). Accepted.
Context: Single-pass LLM output is unreliable. Decision: No result is returned/committed until a critic accepts it vs. acceptance criteria. Consequences: higher quality, measurable error reduction; +one model call per cycle. Accepted.
Context: Tools are the main failure & security surface. Decision: Typed contracts + permission scopes + retries + circuit breaker + audit log. Consequences: resilient and auditable; tools are hot-swappable. Accepted.
Context: Reviewers must run it instantly; CI must be hermetic. Decision: Core has zero runtime deps and a deterministic mock model. Consequences: trivial to run & test; real backends added at the edges. Accepted.