Skip to content

LazyBridge

Build Python agents and pipelines on any engine: a provider API model (Anthropic, OpenAI, Google, DeepSeek, LiteLLM and more), Claude Code or Codex. The three are peers: each is a first-class engine behind the same contract, Agent = Engine + Tools + State, so you swap one for another in one line and keep tools, memory and state. Use API models alone, coding runtimes alone, or mix them in one pipeline and let one engine write while another reviews.

from lazybridge import Agent, ClaudeCodeEngine, CodexEngine, LLMEngine, Memory, Session, Store

def project_status() -> str:
    """Return this example project's status."""
    return "The draft is ready for review."

state = dict(tools=[project_status], memory=Memory(), store=Store(), session=Session())
api = Agent(name="api", engine=LLMEngine("claude-haiku-4-5"), **state)
claude = Agent(name="claude", engine=ClaudeCodeEngine(), **state)
codex = Agent(name="codex", engine=CodexEngine(), **state)
assert api.memory is claude.memory is codex.memory
assert api.store is claude.store is codex.store
assert api.session is claude.session is codex.session
Engine What runs Same Agent, tools and state
LLMEngine A provider API model, any supported provider Yes
ClaudeCodeEngine The Claude Code runtime Yes
CodexEngine The Codex runtime Yes

With a subscription login, coding runtimes use the account's plan quota. The adapters reuse runtime authentication; the configured login can also use another billing path. Provider APIs remain available through LLMEngine. Native Claude sessions and Codex threads keep their own history: switching engines shares Python state, and does not migrate a native transcript.

One writes, the other reviews

from lazybridge import Agent, ClaudeCodeEngine, CodexEngine

reviewer = Agent(name="codex-reviewer", engine=CodexEngine(
    system='Start with "approved" or "rejected: <reason>". Check boundary cases.',
))
writer = Agent(name="claude-writer", engine=ClaudeCodeEngine(),
               verify=reviewer, max_verify=3)
result = writer("Draft a function that blocks weekend deployment.")
print(result.text())

verify= sends the draft and original task to the reviewer, then feeds rejection back into the next attempt. max_verify counts total attempts. Exhaustion returns the last draft even if rejected; use tests and explicit acceptance records before shipping. Opposite-engine review is wired by the caller here.

Claude Code writes, Codex reviews shows the complete pattern and links to repository delegation.

Durable conversations and connected work

Use persist_session / session_id for Claude, persist_thread / thread_id for Codex, or session_alias with a SessionRegistry. Keep native history distinct from Memory, Store and the observability Session.

LazyTools is the integration layer. Its code bridge supports detached jobs, durable approval tickets, results and tier-based opposite-engine review. Its MCP server exposes coding and project tools; projects hold plans, claims and acceptance evidence. Code computes results and renders schedules; deterministic checks decide whether a result may ship.

Quota routing applies a deterministic tier ladder to available telemetry. The quota routing benchmark is in progress; there are no comparative quality, speed or savings results to report.

Start here

Design and documentation map

Engine choice, recursive Tools and optional state keep composition explicit. Use deterministic Plans when control flow should be declared; use model loops when the worker should choose. Type hints derive tool schemas, while Envelopes and opt-in Session/exporters expose results and run evidence.

Need Read next
Composition and convenience forms Everything is a tool, progressive complexity, canonical vs sugar
Basic contracts Agent, Tool, Envelope, native tools
Application state and quality Memory, Store, Session, guards, verify=, evals
Pipelines and human decisions Chain, parallel, as tool, HumanEngine, SupervisorEngine
Deterministic production work Plan, Step, sentinels, routing, parallel bands, checkpoint
Runtime inspection Exporters, GraphSchema, OpenTelemetry, Visualizer
Extensions and integration boundaries Engine protocol, BaseProvider, provider catalogue, Plan serialization, multimodal, LazyTools MCP and gateway
Choosing and recovering Decisions, errors, framework comparison, why

Maturity

This documentation targets LazyBridge 1.11.1. The core is Stable; this does not establish a Stable guarantee for every engine or extension. LazyTools 0.10.1 declares Alpha.

Subsystem Status Boundary
Agent, LLMEngine, Tool, Envelope, Plan, Step, sentinels Stable Core public API; breaking changes require a major version.
Memory, Store, Session, event log, exporters, GraphSchema Stable Persistence and exporters are opt-in; credential redaction is enabled by default.
Provider adapters Stable Model catalogues and runtime capabilities change independently.
Checkpoint/resume and guards Stable Checkpoints do not roll back external side effects.
Claude Code / Codex engines, native persistence and aliases Shipped Runtime-specific permissions, attachments and history; no blanket engine maturity promotion.
Approval, delegation and knowledge extensions Shipped Generic hooks; application policy remains caller-defined.
MCP, code support, code bridge, projects and quota routing LazyTools Alpha See the integration-layer docs rather than importing removed core connectors.
NativeTool, HumanEngine, SupervisorEngine Alpha See the corresponding guides for capability boundaries.
Evals and Visualizer Experimental Extension APIs may consolidate.
Provider fallback-chain tables; automatic PII redaction Planned Explicit Agent(fallback=...) works; default redaction masks credentials, not arbitrary personal data.

See the changelog and migration history for the withdrawn, incompatible April 2026 release numbered 1.0.0.