Skip to content

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

 

History

2 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 

Repository files navigation

simple-langgraph-agent

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.

Files

  • langgraph.json — maps the graph name agent to the async factory make_graph in agent.py.
  • agent.py — builds the model, best-effort loads Action Gateway tools from HARNESS_MCP_SERVERS (degrades to no tools if absent/unreachable), and returns a create_react_agent graph.
  • requirements.txt — dependencies (langgraph, langchain-openai, langchain-core, langchain-mcp-adapters).

Run it locally

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 dev

Run it on DigitalOcean Managed Agents

See 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: allow

The 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

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages