Architecture
This page follows one request through Lobu. For the full data model—connectors, events, entities, automations, and agents—see Architecture and concepts.
One loop behind every agent.
Connect sources, keep governed context current, and expose safe actions to chat, APIs, CLI, and MCP clients.
The request flow
Section titled “The request flow”- A user sends a message from Slack, Telegram, WhatsApp, another supported platform, or your application.
- The gateway authenticates the request, selects the agent, and loads the policy and workspace for that conversation.
- A worker runs the model loop with the agent’s prompt files, skills, thread history, and authorized memory.
- Tool, MCP, secret, and network requests pass through gateway-controlled paths.
- Lobu returns the reply to the original conversation and records the run and its events.
The same boundary applies whether the request starts in team chat, the Lobu web app, or the client and REST APIs.
What runs where
Section titled “What runs where”- Gateway: owns authentication, routing, organization policy, OAuth, secrets, and approvals.
- Worker: runs the model, commands, files, and tools for one conversation workspace. It receives references to credentials, not the credentials themselves.
- Postgres with pgvector: stores configuration, queues, conversation history, events, entities, grants, and proxy sessions. A project created with
lobu initcan use the embedded database; larger deployments can point Lobu at external Postgres.
Workers normally run as isolated child processes. A hardened host can add operating-system limits, and a configured runtime provider can execute work in a remote or device-backed sandbox. These are execution choices; they do not change the gateway’s policy boundary.
Memory across conversations
Section titled “Memory across conversations”Conversation files belong to one workspace. Shared facts belong in Lobu memory, where authorized agents and automations can find them across sessions.
The gateway resolves the memory workspace from the organization declared in lobu.config.ts. See Memory for the conceptual model and Agent settings for configuration.
The security-critical path
Section titled “The security-critical path”- Workers receive opaque secret references; the secret proxy substitutes real values only when an allowed request leaves the worker.
- Outbound traffic follows the agent’s network and tool policy.
- The MCP proxy resolves the correct user or organization credential and applies gateway policy before forwarding a tool call.
- Guardrails can inspect input, output, tool calls, and selected network requests independently of the prompt.