A minimal LangGraph tool-calling
agent (create_react_agent). Built to run unmodified both locally and as a
DigitalOcean Managed Agents "framework" agent (agent: langgraph).
No DigitalOcean-specific imports. Model config comes from plain
HARNESS_INFERENCE_* env vars; tool config comes from HARNESS_MCP_SERVERS,
a base64-encoded JSON array DigitalOcean injects into the guest only when the
agent spec's tools: block references do.actions (Action Gateway). Both
are just env vars / a plain HTTP MCP endpoint, so the exact same code runs
locally against any OpenAI-compatible model + MCP server.
langgraph.json— maps the graph nameagentto the async factorymake_graphinagent.py.agent.py— builds the model, best-effort loads Action Gateway tools fromHARNESS_MCP_SERVERS(degrades to no tools if absent/unreachable), and returns acreate_react_agentgraph.requirements.txt— dependencies (langgraph,langchain-openai,langchain-core,langchain-mcp-adapters).
pip install -r requirements.txt
export HARNESS_INFERENCE_API_KEY="<your-key>"
export HARNESS_INFERENCE_BASE_URL="https://inference.do-ai.run/v1" # or any OpenAI-compatible endpoint
export HARNESS_INFERENCE_MODEL="deepseek-v4-pro"
langgraph devSee the DigitalOcean Managed Agents partner guide, "Running your own LangGraph graph." In short:
name: my-langgraph-agent
agent: langgraph
template: langgraph
size: mv-2vcpu-4gb
persistent_workspace: true
env:
FRAMEWORK_REPO: "https://github.com/<owner>/simple-langgraph-agent.git"
FRAMEWORK_REPO_SHA: "<exact-commit-sha>"
HARNESS_INFERENCE_BASE_URL: "https://inference.do-ai.run/v1"
HARNESS_INFERENCE_MODEL: deepseek-v4-pro
secrets:
HARNESS_INFERENCE_API_KEY: "<your-do-api-key>"
tools:
- do.actions: [exa_web_search, exa_web_fetch]
permissions:
default: allow
rules:
- tool: do.actions/exa_web_search
action: allow
- tool: do.actions/exa_web_fetch
action: allowThe tools: block is what makes harness-api mint a session-pinned Action
Gateway MCP session and inject its URL as HARNESS_MCP_SERVERS; agent.py
picks that up automatically and binds exa_web_search/exa_web_fetch onto
the model. Omit tools: and the agent still runs, just with no tools bound.
doctl open-harness-runtime start --spec langgraph-spec.yaml
doctl open-harness-runtime attach my-langgraph-agent