ollupi

module
v0.16.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 17, 2026 License: MIT

README

Ollupi

Ollupi is a Go agent framework for cloud providers building massively concurrent personal agent services.

Instead of isolating each agent in its own VM or container, Ollupi pools the runtime and persists each agent's run state:

  • Recoverable at any moment. Every step is written to the database before it runs, and no scheduling state lives in memory. After a release, restart or crash, sessions continue from where they stopped.
  • Inactive sessions cost nothing. A session waiting on a user, an approval or a subagent leaves the execution pool and remains only as database records, using no memory or compute.
  • Controlled concurrency. The execution pool schedules by slot, and model calls are limited per connection to match the provider's account quota; bursts queue.

Sessions, subagents and scheduled tasks all share one execution pool. ollupi-desktop is the desktop client built on Ollupi.

Ollupi architecture

How it differs from per-agent isolation

One VM or container per agent Ollupi
One process hosts One session All sessions
Inactive sessions Process stays up, or is rebuilt with a cold start Database records only
Waiting on a user or approval Process sits suspended, still holding memory Leaves the execution pool, using no resources
Scheduling state Process memory SQLite
After a restart In-progress work is interrupted Continues from where it stopped
Subagents Special mechanism or child process Ordinary sessions, queued in the same pool
Scheduled tasks External cron starts a process A message to the session when due, queued in the same pool

Per-agent isolation compared with Ollupi

Benchmarks

These results use a simulated model and tools. They measure scheduling and persistence, not model quality. See bench for the method, full data and commands to reproduce them.

Comparison with pi and DeepSeek Harness

Memory

Capacity

Burst and quota

Recovery

Mixed load

Faults and long tail

Long run

Execution model

Shared execution pool

Every runnable turn in every session, whether it comes from a user, a subagent or a scheduled task, enters one queue and runs on a fixed number of slots (32 by default). A turn waiting on a user, an approval or a subagent releases its slot, holds no goroutine or model concurrency, and becomes ready again when the wait ends. When slots run short, ordinary sessions go before subagents, and turns of the same kind run in the order they became ready. Model concurrency is limited per connection (4 per connection by default), and tool execution uses none of it. Model requests that hit a 429, a 5xx or a dropped connection retry with backoff, up to 8 times, keeping their slot and model concurrency while they wait.

Each conversation is an append-only log: a turn's state, what it waits on and what runs next are read from the log, every step is appended before it runs, and no scheduling state lives in memory, so after a process restart the same logic picks up in-progress turns. A tool call appended but not started runs as usual; one started without a result may have taken effect, so it is ended as cut off with a prompt to verify, and is never run twice. Everything a commit changes reaches clients, the scheduler and memory extraction through one change feed, numbered by commit.

Multi-user and shards

One database is one shard. Users in a shard share tables and are isolated per user. The engine knows nothing of shards: package shard runs a process as one. A shard.Member holds the shard's lease in the deployment's catalog, which publishes the holder's address with it, so only one process runs a shard at a time; when that process exits, a standby that waits on the lease takes over and continues from where it stopped. Each taking of a shard has an epoch above every one before it, which the shard's database keeps and checks on every write, so a process that stalled past its lease cannot write over the one that took the shard. The member reports the shard's load as it renews the lease, by a measure the deployment chooses (users active of late, turns under way, connections), and runs the engine only while it holds the shard. The number of shards sets capacity. Clients reach one address and never learn which shard they are on: where a load balancer can call out over Envoy's external processing protocol, as Google Cloud's Application Load Balancer does with a route extension, router/extproc tells it each handshake's shard in the x-ollupi-shard header and the load balancer holds the connections; router.Router takes the connections it cannot place, and anywhere without such a load balancer it takes them all. Both find the shard and its holder's address with one catalog lookup, which places a new user on the lighter of two accepting shards drawn at random, by the load each reports. The catalog is kept apart from the shards' data, behind the interface catalog.Catalog (catalog). It decides each lease by its own clock, and a holder counts its lease from before it asked and gives up a margin early, so that it stops before any other process can start. catalog.SQL keeps the catalog in a SQLite database of its own; a deployment that needs it to outlive any one machine implements catalog.Catalog over a coordination service, such as etcd, or a database served apart from the shards. A shard only checks that a connection is its user's, through gateway.Options.Admit set to shard.Member.Admit, and tells one that is not to come back later (503 with Retry-After). A process serves, and answers /healthz, only while it holds its shard, so a load balancer's health check sends the shard's connections to the process that holds it.

Everything a user runs stays in their own sandbox: commands, files and MCP servers are reached through sandbox.Box, and integrating a cloud sandbox only takes implementing sandbox.Machine. A user's environments are the boxes a conversation can be started in — this machine, and cloud sandboxes they add — and a conversation keeps the one it was started in (environment/list, thread/start with environmentId). HTTP MCP requests from cloud sandbox users leave from the shard process and can only reach public addresses. Model calls can go through the user's own client, and attachments are stored through blobs.Store.

Two choices of the sandbox trade safety for ordinary work. A repository's .git is writable inside it, hooks included, so git init and git clone work there; a hook a command writes runs later for whoever runs git outside the sandbox. Under the never approval policy, a command that asks to leave the sandbox runs on the host without asking; a server that runs users' commands with sandbox.Here should not offer that policy.

Building and testing need SQLite's FTS5: go test -tags sqlite_fts5 ./..., or set GOFLAGS=-tags=sqlite_fts5.

Clients authenticate with Authorization: Bearer <token>. Browsers can't set this header, so they put the token in the WebSocket subprotocol instead: new WebSocket(url, ["ollupi.token", token]). Tokens never go in the URL.

A user may hold up to four connections at once, one per device, and each hears all of the user's events; a fifth takes the oldest's place, which closes with 4000 and should not reconnect on its own. The gateway pings each connection every 30 seconds and drops one whose peer has not answered within 15, and closes each with 1001 at a random time between 15 and 20 hours after it opened, under the 24 hours Google Cloud's load balancer keeps a WebSocket open, so that connections opened together are not cut together. Connections are admitted at a bounded rate, so after a restart a client may be refused with 503 and a Retry-After in seconds. gateway.Options.Connections changes these bounds. What a client does after each close code and each refused handshake is part of the protocol, under closes and handshakes in protocol.schema.json: reconnect after a random wait of up to 10 seconds, with backoff, after Retry-After, or not on its own; once back, it reads its threads again, since it heard nothing meanwhile.

License

MIT

Directories

Path Synopsis
Package agent is what an agent does next.
Package agent is what an agent does next.
Package app is what a user can do: each command reads what it needs, checks it by the core's rules and writes it in one transaction; each query reads one snapshot.
Package app is what a user can do: each command reads what it needs, checks it by the core's rules and writes it in one transaction; each query reads one snapshot.
Package ask is what an agent asks the user mid-call, and the answers that may come back: the questions are the call's request, the answers its output.
Package ask is what an agent asks the user mid-call, and the answers that may come back: the questions are the call's request, the answers its output.
Command bench runs ollupi's experiments against fake models and tools:
Command bench runs ollupi's experiments against fake models and tools:
Package blob keeps files that outlive a process and are not part of a database.
Package blob keeps files that outlive a process and are not part of a database.
Package catalog keeps what all shards of a deployment share: which shard each user is on, which process holds each shard now and where it is reached, and how busy each shard is.
Package catalog keeps what all shards of a deployment share: which shard each user is on, which process holds each shard now and where it is reached, and how busy each shard is.
Package conversation is a conversation as what it is: a log that only grows.
Package conversation is a conversation as what it is: a log that only grows.
Package cron runs scheduled tasks: a task is a prompt sent to its conversation at the times a cron spec names, in the deployment's time zone.
Package cron runs scheduled tasks: a task is a prompt sent to its conversation at the times a cron spec names, in the deployment's time zone.
Command eval runs one benchmark task through ollupi's agent inside the task's container and exits: one user, one conversation, one turn.
Command eval runs one benchmark task through ollupi's agent inside the task's container and exits: one user, one conversation, one turn.
Package extract learns a user's long-term memory from their turns as they end: it hears of them on the store's feed, reads each in the order they ended, and keeps what a model takes from it.
Package extract learns a user's long-term memory from their turns as they end: it hears of them on the store's feed, reads each in the order they ended, and keeps what a model takes from it.
Package gateway is the protocol clients speak to a shard: JSON-RPC over a WebSocket.
Package gateway is the protocol clients speak to a shard: JSON-RPC over a WebSocket.
Package host puts ollupi together into one process: the store, the models, every user's tools, the flows that run turns, learn memory and send scheduled tasks, the app, and the gateway clients reach it by.
Package host puts ollupi together into one process: the store, the models, every user's tools, the flows that run turns, learn memory and send scheduled tasks, the app, and the gateway clients reach it by.
Package memory is what a user's long-term memory is and the rules it keeps: which notes a conversation recalls, what a finished turn offers as evidence, how a model's operations on the notes are checked and applied, and how the user corrects them.
Package memory is what a user's long-term memory is and the rules it keeps: which notes a conversation recalls, what a finished turn offers as evidence, how a model's operations on the notes are checked and applied, and how the user corrects them.
pkg
llm
render
Package render reads a call's output as the text it shows: structured output as indented JSON, and in each string of it a run of decorative lines, such as a table's borders, as one "...".
Package render reads a call's output as the text it shows: structured output as indented JSON, and in each string of it a run of decorative lines, such as a table's borders, as one "...".
sqlitedb
Package sqlitedb opens a SQLite file for one process and brings its schema forward.
Package sqlitedb opens a SQLite file for one process and brings its schema forward.
wshub
Package wshub keeps a process's WebSocket connections, whatever they carry: it admits new ones at a bounded rate, holds a few for each key and gives the oldest up for a newer one, closes those whose peer stops answering pings or that reach their age, and closes all of them when the process stops.
Package wshub keeps a process's WebSocket connections, whatever they carry: it admits new ones at a bounded rate, holds a few for each key and gives the oldest up for a newer one, closes those whose peer stops answering pings or that reach their age, and closes all of them when the process stops.
Package policy decides what a tool call may do: whether it runs, asks the user first, or is refused.
Package policy decides what a tool call may do: whether it runs, asks the user first, or is refused.
Package prompt compiles a conversation into what a model is sent: the system prompt, the transcript fitted into the model's context window, with long tool outputs clipped and a compacted history standing for what came before, and the tools that fit.
Package prompt compiles a conversation into what a model is sent: the system prompt, the transcript fitted into the model's context window, with long tool outputs clipped and a compacted history standing for what came before, and the tools that fit.
Package router finds the shard each client connection belongs on, ahead of the shards: through a load balancer's callout (router/extproc), or as a proxy (Router) where the load balancer cannot route on its own.
Package router finds the shard each client connection belongs on, ahead of the shards: through a load balancer's callout (router/extproc), or as a proxy (Router) where the load balancer cannot route on its own.
extproc
Package extproc places each client connection on its user's shard from inside a load balancer that calls out over Envoy's external processing protocol, as a Google Cloud Application Load Balancer route extension and Envoy's ext_proc filter do.
Package extproc places each client connection on its user's shard from inside a load balancer that calls out over Envoy's external processing protocol, as a Google Cloud Application Load Balancer route extension and Envoy's ext_proc filter do.
Package run runs a turn: it reads the conversation, asks agent.Next what to do, does it, and appends what came of it to the log, a step at a time, until the turn waits or ends.
Package run runs a turn: it reads the conversation, asks agent.Next what to do, does it, and appends what came of it to the log, a step at a time, until the turn waits or ends.
Package schedule gives runnable conversations a slot to run in.
Package schedule gives runnable conversations a slot to run in.
Package shard runs a process as one shard of a deployment: it holds the shard's lease in the deployment's catalog, fences the shard's database with the lease's epoch, reports the shard's load as it renews the lease, and runs the engine only while it holds the shard.
Package shard runs a process as one shard of a deployment: it holds the shard's lease in the deployment's catalog, fences the shard's database with the lease's epoch, reports the shard's load as it renews the lease, and runs the engine only while it holds the shard.
Package store is where a shard keeps what it knows: each conversation's log and the views folded from it, beside the headers of the conversations.
Package store is where a shard keeps what it knows: each conversation's log and the views folded from it, beside the headers of the conversations.
sqlite
Package sqlite keeps a shard's store in one SQLite database.
Package sqlite keeps a shard's store in one SQLite database.
Package tool is what a runner calls tools through: a user's set of tools, each described, prepared and invoked.
Package tool is what a runner calls tools through: a user's set of tools, each described, prepared and invoked.
builtin/ask
Package ask gives the model request_user_input: the call asks the user questions, and ends with their answers.
Package ask gives the model request_user_input: the call asks the user questions, and ends with their answers.
builtin/loader
Package loader gives the model load_tools, which loads the tools a turn defers: the ones named to the model in DEFERRED TOOLS without their definitions, when not all fit.
Package loader gives the model load_tools, which loads the tools a turn defers: the ones named to the model in DEFERRED TOOLS without their definitions, when not all fit.
builtin/memory
Package memory gives the model memory_search, which finds the notes of long-term memory a conversation was not shown when it started.
Package memory gives the model memory_search, which finds the notes of long-term memory a conversation was not shown when it started.
builtin/outputs
Package outputs gives the model read_tool_output, which reads the part of a tool output the conversation shows shortened: the prompt cuts a long output and names the characters it left out, of the output's text as it renders it.
Package outputs gives the model read_tool_output, which reads the part of a tool output the conversation shows shortened: the prompt cuts a long output and names the characters it left out, of the output's text as it renders it.
builtin/skills
Package skills gives an agent the tools of the skills its role has: listing them, activating one, and reading its resources.
Package skills gives an agent the tools of the skills its role has: listing them, activating one, and reading its resources.
builtin/subagent
Package subagent gives the model the tools that launch subagents: each is named after the role its subagent runs as, and its call starts the subagent's conversation with the task; the subagent's report comes back to the turn.
Package subagent gives the model the tools that launch subagents: each is named after the role its subagent runs as, and its call starts the subagent's conversation with the task; the subagent's report comes back to the turn.
builtin/tasks
Package tasks gives the main agent the tools of its conversation's scheduled tasks: creating, pausing, deleting and listing them, as the user would.
Package tasks gives the main agent the tools of its conversation's scheduled tasks: creating, pausing, deleting and listing them, as the user would.
builtin/web
Package web gives the model web_fetch: read a public web page as text.
Package web gives the model web_fetch: read a public web page as text.
kit
Package kit is how tools are built: a provider names its tools and runs them, and a registry gathers providers into the tool.Set a runner calls.
Package kit is how tools are built: a provider names its tools and runs them, and a registry gathers providers into the tool.Set a runner calls.
mcp
Package mcp runs each user's MCP servers in their sandbox, and gives a user's tools: the built-in ones beside those of their servers.
Package mcp runs each user's MCP servers in their sandbox, and gives a user's tools: the built-in ones beside those of their servers.
Package user is what a user owns and sets for themselves: their settings, their workspaces, the environments their conversations run in, their conversations' headers and their MCP servers, with the rules each keeps.
Package user is what a user owns and sets for themselves: their settings, their workspaces, the environments their conversations run in, their conversations' headers and their MCP servers, with the rules each keeps.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL