← Agent Engine

Stack and structure

agent-engine · workzone
Backend
stack — libraries
Background launch → Execution lanes
SAQ · run queue SAQ cron → Cache & Workers
Agentic loop / Models → Agentic loop
chat-client · tool-calling AI KS primitives as tools → Knowledge Store
Storage → Data model
SQLAlchemy 2.0 · async asyncpg Alembic
Framework
FastAPI Pydantic v2
structure — files · achilles/agent_engine/
agent_engine/      module = its own package
├── *.py           router · service · schemas · constants
├── runtime/       agentic loop: prompt composition → tools → output
└── scheduler/     schedule + enqueueing runs onto the background queue
Why runtime/ is its own folder
The agentic loop is a layer of its own on top of the service: composing the prompt layers, calling the KS tools, multi-step reasoning, and writing the output to the run journal. The search, graph, and sql primitives themselves live in Knowledge Store, not here.
Frontend
Agent Engine has no frontend of its own. The employee screens (my agents, the editor with a run journal and “Run now”) and the admin ones (list of all agents, read-only profile, admin lock) are rendered by the surfaces as thin clients of the shared API. For the employee that’s → Web App, for the admin — → Admin Panel.
The tool-calling harness is a shared layer, not ours. The chat-client with tools under the engine is one per platform, shared with Query Engine; its home is a separate page, Tool-calling harness. Agent Engine merely parameterizes it — three tools (search / graph / sql) and a loop up to the iteration cap.
External orchestration — not in v1. The agent core doesn’t talk to external APIs directly. For complex cross-system orchestration, Achilles acts as a node in an n8n workflow (a separate container) — External orchestration.