Framework
Build for your domain.
Keep the work moving.
Cayu is an open-source Python framework for building domain-specific long-horizon agents. Assemble the harness around your expertise, with durable execution built in.
01 / The whole picture
One framework.
The pieces of your agent.
You build with Cayu’s Python APIs and components. The harness you assemble defines how the agent works; the integrated runtime supports its execution. Together, they power your domain-specific product.
| Concept | Its role in Cayu |
|---|---|
| Framework | The Python structure, APIs, defaults, and components you build with. |
| Harness | The system you assemble with Cayu: context, tools, memory, policies, domain logic, and verification. |
| Runtime | The integrated execution machinery: sessions, state, workers, recovery, approvals, and budgets. |
| Agent | The resulting product that performs work in your domain. |
The harness is specific to your domain. The runtime provides reusable execution capabilities that you configure for the job.
02 / Assemble the harness
Put your expertise
into how the agent works.
Start with Cayu’s defaults, then compose the context, tools, rules, and checks the job needs. Your team controls the behavior through editable Python.
Context & knowledge
Choose the documents, records, instructions, and evidence the model sees at each step.
For document review: required fields and source records.
Tools & integrations
Connect Python functions, business systems, and external capabilities to the work.
Read documents, look up records, and prepare a review report.
Domain logic
Express the rules, calculations, and workflows specific to the job in ordinary Python.
Validate fields and route exceptions using your business rules.
Memory
Define what the agent retains, how it retrieves prior work, and which knowledge needs review.
Recall reviewed exceptions and relevant earlier decisions.
Policies & approvals
Set the permitted actions, spending limits, and points where a person must decide.
Require review before writing back to a business system.
Verification & evals
Define completion checks and evaluation cases for the result and the path taken.
Check coverage, source evidence, and handling of exceptions.
Illustrative job: review 5,000 documents, flag exceptions, and produce a report with evidence.
Explore the application structure03 / Build the agent
From a defined job
to a working application.
- 01
Define the job and its finish line.
Specify the inputs, expected outputs, success criteria, and decisions that need human review.
- 02
Start a Python project.
cayu new myagentcreates a project with places for prompts, tools, policies, memory, domain code, tests, and evals. - 03
Compose and configure.
Add your domain behavior, choose a model provider, connect the tools, and configure storage, approvals, and budgets.
- 04
Evaluate, then put it to work.
Check representative cases, inspect a run, and refine the harness before deploying it for the people using the agent.
What the starter includes
The default scaffold starts with a model-only agent, durable stores, a test, and an output evaluation. The project has explicit places for other capabilities; you add and configure the ones your job needs. Provider credentials are configured separately.
Build directly in Python, or use Codex, Claude Code, or Cursor to help develop your Cayu project.
04 / Integrated runtime
Let the work continue
across hours and days.
A long-horizon agent accumulates state, makes many decisions, and may wait for people or external systems. Cayu includes the execution machinery to keep that work recorded and controlled.
Durability & recoveryKeep the work when a process stops.
Long executions need a history that survives the worker. Cayu records sessions, events, and checkpoints in your configured durable stores.
- Resume or fork a session from recorded state.
- Persist approvals and interruptions across restarts.
- Fence stale workers through leases and ownership checks.
- Reconcile uncertain external effects before deciding whether to continue.
A tool may have acted even if its result never arrived. Recovery preserves that uncertainty; your application uses external evidence or a human decision to resolve it.
Read the recovery contractsTools, permissions & secretsGive the agent the authority its job needs.
Declare tool capabilities, enforce policies, and ask for approval at the actions that matter. Keep credential handling inside the boundaries you configure.
- Typed tools and explicit effect declarations.
- Policies and approvals scoped to the requested action.
- Virtual credentials with destination-bound, revocable egress.
- Configured redaction before results are persisted.
- Taint-aware tool policy and fail-closed checks for changed MCP manifests.
Native Python tools are trusted application code. Use configured credential proxies and governed execution environments where required; tool permissions do not create an operating-system sandbox.
Explore virtual credentialsTasks, workers & environmentsCoordinate work beyond a single request.
Compose the task lifecycle in Python, with durable records for how work starts, runs, waits, delegates, and continues.
- Journaled workflows with resumable steps and replay.
- Task dispatch, worker leases, and heartbeats.
- Subagent lineage and recovery-aware reattachment.
- Session workspaces and durable artifacts.
- Replaceable runners and environment factories.
Choose the execution boundary for the workload. Local execution is for trusted code; configure an appropriate isolated or remote runner for other workloads.
See how work starts and continuesModels, context & memoryKeep control of what the model sees.
Use your preferred provider and define how the harness assembles context, retrieves knowledge, invokes tools, and validates the next result.
- OpenAI, Anthropic, Bedrock, Vertex, and compatible or custom providers.
- Tool-based and native structured output.
- Validation with bounded repair.
- Token counting, compaction, and context-overflow recovery.
- Prompt-cache-aware context management.
- Knowledge and memory stores behind replaceable contracts.
Provider capabilities vary. Configure the model’s supported controls and evaluate behavior when changing providers, context strategies, or models.
Explore model providersBudgets, observability & evalsSee what happened. Measure what improved.
Make execution visible alongside the final result. Track model usage, apply budget policy, and evaluate the work against criteria your team owns.
- Budget reservations and settlement using your price book.
- Causal cost attribution across retries, branches, and subagents.
- Structured events, OpenTelemetry, and the packaged operator dashboard.
- Trajectory evals, run comparisons, and offline replay.
- SQLite or PostgreSQL persistence with migrations.
Recorded usage and estimated model cost are distinct. Cost depends on your price book and available provider usage. Evals measure the criteria you define; they do not establish correctness beyond those checks.
Explore evaluations05 / Verify and improve
Define what good work
looks like in your domain.
Build evaluations around your business rules, expected outputs, and permission boundaries. Inspect the recorded session as well as the final answer.
- Turn representative jobs and reviewed failures into evaluation cases.
- Check outputs, tool use, approvals, and the evidence supporting completion.
- Compare changes to prompts, models, tools, or policies before adopting them.
- Use session forks, replay, and comparison results in your own improvement process.
Your evaluations cover the criteria you define. Your application decides how candidate changes are generated, reviewed, and released.
Explore evaluations06 / Deploy and operate
Your agent.
Your operating environment.
Run the Cayu application where your models, data, and business systems live. Choose your providers, storage, and execution environment. Cayu Cloud is optional.
Your Python application
Develop locally and deploy on your own infrastructure. Build the interface, authentication, and business authorization your users need.
The included operator dashboard
Inspect sessions, workflows, usage, and evals alongside the agent’s application. Configure durable storage and access policies for your deployment.
Cayu Cloud for your team
Use a shared workspace to build in Console, deploy agents, manage operations, and evaluate improvements with Compound.
Explore Cayu CloudInfrastructure and execution boundaries
Deploy on your cloud account, a private network, or on-premises. Choose a suitable shared store for concurrent workers and an execution environment appropriate to the workload. Air-gapped operation requires models and dependencies available inside that boundary. Native Python tools are trusted application code.
Compound focuses on evaluations and reviewed improvement. Its planned Self Improvement — Genetic Algorithm experience is Coming.
Under the hood
Python components
you can inspect and extend.
Start with the defaults. Configure or replace the components your harness and application need.
IdentityWho is doing the work?
Identity and model behavior remain visible as explicit runtime configuration.
ContextWhat does it know right now?
Your configured context policy controls what enters context, what stays, and what gets summarized.
CapabilityWhat can it attempt?
Capabilities are typed and registered. A tool’s effect is distinct from permission to use it.
AuthorityWhat is it authorized to do?
Authority can depend on arguments, provenance, external state, or a human decision.
ExecutionWhere does it act?
The same agent can move between local, isolated, remote, or application-owned execution.
AccessHow does it reach the outside world?
The agent can use an authorized capability without receiving the underlying secret.
DurabilityWhat survives a crash?
Long-running work can resume across process boundaries with its causal history intact.
RecoveryWhat if an effect is uncertain?
The runtime checks durable state and external evidence before recovery continues.
EconomicsHow much may it consume?
Cost belongs to the operation, including retries, branches, subagents, caching, and compaction.
OrchestrationHow does work continue?
Durable runtime primitives let work react, delegate, branch, and continue.
EvidenceHow do we prove it is better?
The full path through the runtime becomes evidence alongside the final answer.
ImprovementHow does it improve?
Comparisons, policies, and hooks let you select verified changes and update behavior.
Measured evidence
Inspect the cost
of the choices you make.
Context and memory choices affect long-horizon execution. Two published benchmarks compare context strategies using Claude Haiku 4.5.
View the paired benchmark results
Prompt-cache compaction
Model-cost reduction across three paired first-compaction trials.
Compacted research branches
Model-cost reduction across three paired sets of research branches.
Historical measurements · July 13, 2026 · Model, prompt, cache state, and pricing specific. Setup is outside the paired comparison; research evaluation and repair are also outside its measured calls. These are not whole-workflow or universal token-savings claims.
Domain-specific long-horizon agents