Skip to content

Configuration

config/langgraph-config.yaml is the canonical runtime config. Loaded at server boot by graph/config.py::LangGraphConfig.from_yaml(). All fields have defaults; the YAML only needs to override what's changing.

Full example

yaml
model:
  provider: openai
  name: protolabs/agent
  api_base: http://gateway:4000/v1
  api_key: ""
  temperature: 0.2
  max_tokens: 4096
  max_iterations: 50

subagents:
  worker:
    enabled: true
    tools: [echo, current_time, calculator, web_search, fetch_url]
    max_turns: 20

middleware:
  knowledge: false
  audit: true
  memory: false

knowledge:
  db_path: /sandbox/knowledge/agent.db
  embed_model: nomic-embed-text
  top_k: 5

model

KeyDefaultWhat
provideropenaiLangChain LLM provider. The template's graph/llm.py only uses openai (via LiteLLM gateway).
nameprotolabs/agentGateway alias or direct model name.
api_basehttp://gateway:4000/v1OpenAI-compatible endpoint.
api_key""Falls back to the OPENAI_API_KEY env var.
temperature0.2Sampling temperature.
max_tokens4096Per-call output cap.
max_iterations50Upper bound on tool-call loops per task.

subagents

One entry per subagent name. Each entry matches a SubagentConfig in graph/subagents/config.py and a SubagentDef field in LangGraphConfig.

KeyDefaultWhat
enabledtrueIf false, the subagent is still registered but dispatches return "disabled" errors.
tools[]Allowlist. Tool names not listed here are invisible to this subagent.
max_turns30Recursion cap.

Adding a new subagent name to the YAML requires matching entries in graph/subagents/config.py::SUBAGENT_REGISTRY, graph/config.py::LangGraphConfig, and the from_yaml() loop. See Configure subagents.

middleware

KeyDefaultWhat
knowledgefalseInject retrieved knowledge into state before LLM calls. Requires a knowledge store — leave off until you add one.
audittrueAppend every tool call to /sandbox/audit/audit.jsonl.
memoryfalseMemory middleware (experimental). Requires a knowledge store.

knowledge

Only read when middleware.knowledge is true.

KeyDefaultWhat
db_path/sandbox/knowledge/agent.dbSQLite file path.
embed_modelnomic-embed-textEmbedding model.
top_k5Results per query fed into state.

The template does not ship a knowledge store — the config keys are kept so a fork can flip the switch without rewiring every call site.

Part of the protoLabs autonomous development studio.