Documentation

GantryGraph is an open-source Python library for building autonomous AI agents that control the desktop, browser, filesystem, and external services. Every agent runs a observe → think → act → review loop backed by LangGraph.

from gantrygraph import GantryEngine, gantry_tool
from langchain_anthropic import ChatAnthropic

@gantry_tool
def search_db(query: str) -> str:
"""Search the product database and return matching rows."""
return db.execute(query)

agent = GantryEngine(
llm=ChatAnthropic(model="claude-sonnet-4-6"),
tools=[search_db],
)
print(agent.run("Find all orders placed in the last 7 days."))

Get started

Quickstart
From zero to a working agent in under 5 minutes.
How the agent loop works
The four steps — observe, think, act, review — and when each runs.
Tools and actions
@gantry_tool, built-in tool groups, MCP, and BaseAction.
Perception sources
How the agent sees: DesktopScreen, WebPage, and custom sensors.

Build agents

Build custom tools
Turn any function into an LLM-callable tool. Supports sync, async, and stateful groups.
Read and write files
FileSystemTools and ShellTools with sandboxed workspace access.
Create a browser agent
Navigate websites, fill forms, and scrape data with stealth Playwright.
Create a desktop agent
Control mouse, keyboard, and monitor any app on the screen.
Connect services with MCP
GitHub, Notion, Postgres, and hundreds more — zero integration code.
Add web search
Search the web via Tavily API — no CAPTCHA, structured results.
Add memory
Let the agent remember facts across steps or across multiple runs.
Run agents in parallel
Decompose tasks across specialist workers with GantrySupervisor.

Secure and control

Guardrails overview
All six security layers: approval gate, shell firewall, secrets, workspace, budget, and destructive flag.
Require human approval
Gate dangerous tool calls with a callback or suspend/resume pattern.
Monitor execution
telemetry=stdout shortcut, event callbacks, streaming, and OpenTelemetry traces.

Deploy and reference

Deploy as a REST API
Wrap any agent in an HTTP server with POST /run, SSE streaming, and suspend/resume.
API Reference
Full parameter tables for GantryEngine, all tools, security policies, and graph primitives.