Skip to content
API Blog

Architecture

This page follows one request through Lobu. For the full data model—connectors, events, entities, automations, and agents—see Architecture and concepts.

Operating loop

One loop behind every agent.

Connect sources, keep governed context current, and expose safe actions to chat, APIs, CLI, and MCP clients.

Connect the work
built-ins, live events, or code
Build shared memory
Goal
watch renewal risk
entitiestable
nametypeupdated
Customer Acompany2d
Customer Bperson5h
Customer Cmeeting1h
records humans can inspect and edit
Act anywhere
Team channels
Agent access
CLIMCPAPISDK
same memory, same guardrails
  1. A user sends a message from Slack, Telegram, WhatsApp, another supported platform, or your application.
  2. The gateway authenticates the request, selects the agent, and loads the policy and workspace for that conversation.
  3. A worker runs the model loop with the agent’s prompt files, skills, thread history, and authorized memory.
  4. Tool, MCP, secret, and network requests pass through gateway-controlled paths.
  5. 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.

  • 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 init can 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.

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.

  • 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.