Architecture
What LAP is made of
LAP is one service and one database. The service receives requests, runs agents and serves the operator console. The database holds run state, queues, knowledge and audit. Models and external systems are reached through a policy layer; nothing else is required.
How a run moves
Every interaction is a run: a chat question, a scheduled job or an inbound event enter the same way and pass the same checks. Identity and policy are resolved first, the run is queued, and a worker executes the agent step by step, recording each model call and each external action. An action that needs a human decision pauses the run until a person decides. The result, the cost and the full event history are stored with the run.
What it connects to
Agents reach three kinds of things, each through one control point. Models go through the gateway, which applies the tenant's policy, budget, timeouts and metering. Tools and external systems go through a wrapper that applies permissions, approval rules and audit. Documents are retrieved under the caller's permissions, and answers cite what they used. Providers, tools and sources are configuration, so swapping one changes no agent code.
Where the controls sit
Policy, budgets, approvals, tracing and audit are properties of the platform, not of individual agents. Every run carries its identity and scope from the first check to the last record, every step is traced, and every state change, approval, action and cost is written to an append-only record that operators can inspect and export.
How it deploys and scales
The single-node profile is one service and one database, small enough for one machine. Production runs the same system as separate API and worker replicas, with capacity added by adding processes. Interactive work, background work and document ingestion are kept apart so one cannot starve another.
What happens when something fails
A run survives the failure of the process running it: another worker resumes it from the last completed step. Actions with external effect are recorded before and after they happen, so a retry does not repeat an action that already went through. Cancellation and deadlines stop work promptly and release its capacity. Releases are versioned, and a bad release is rolled back by releasing the previous version.