Skip to content

DeepAgent Runtime (LangGraph)

DeepAgentExecutor runs in-process agents via LangGraph’s createReactAgent. This is the default runtime for all agents defined in workspace/agents/*.yaml.

Type string: deep-agent Package: @langchain/langgraph + @langchain/openai Registered by: AgentRuntimePlugin — one executor per agent YAML file at install() time.

  1. AgentRuntimePlugin scans workspace/agents/ on startup and creates one DeepAgentExecutor per YAML file
  2. Each executor is registered in ExecutorRegistry for the skills listed in the agent’s YAML
  3. When SkillDispatcherPlugin routes a SkillRequest to this executor, it:
    • Creates a LangGraph ReAct agent with ChatOpenAI pointed at the LiteLLM gateway
    • Resolves the system prompt: if the matched skill has systemPromptOverride, uses that; otherwise uses the agent’s systemPrompt
    • Appends a cached world state snapshot for instant situational awareness
    • Provides LangChain tools matching the tools whitelist from the agent YAML
    • Runs the agent loop with recursionLimit derived from maxTurns
    • Returns the final AI message as SkillResult.text
workspace/agents/ava.yaml
name: ava
role: general
model: claude-opus-4-6
systemPrompt: |
You are Ava, the chief-of-staff protoAgent...
tools:
# Orchestration
- chat_with_agent
- delegate_task
- publish_event
- manage_cron
- run_ceremony
# Observation
- get_world_state
- get_projects
- get_ci_health
- get_pr_pipeline
- get_branch_drift
- get_outcomes
- get_incidents
- get_cost_summary
- get_confidence_summary
- web_search
# Write / Act
- manage_board
- create_github_issue
- report_incident
- propose_config_change
# Conversation
- react
- send_update
- msg_operator
maxTurns: 25
discordBotTokenEnvKey: DISCORD_BOT_TOKEN_AVA
skills:
- name: chat
description: Operational helm — the user's single control interface.
keywords: []
- name: goal_proposal
description: Draft goals.yaml entries from chronic failure clusters.
keywords: [goal, proposal, cluster, outcome]
systemPromptOverride: |
You are Ava performing a goal proposal analysis...
- name: debug_ci_failures
description: Investigate CI failures, delegate to Quinn, file issues.
keywords: [ci, failure, build, pipeline]

When a skill declares systemPromptOverride, the executor uses it instead of the agent’s main systemPrompt for that specific invocation. This allows structured-output skills (like goal_proposal and diagnose_pr_stuck) to use narrow, format-enforcing prompts while operational skills use the full conversational prompt.

See Agent Skills Reference for the full YAML schema and available tools.

Tools are defined as LangChain tools with zod schemas in DeepAgentExecutor. Each wraps an HTTP call to workstacean’s own API. Agents only get the tools listed in their tools: array — unlisted tools are not available.

ToolAPI endpointPurpose
chat_with_agentPOST /api/a2a/chatMulti-turn A2A conversation with another agent
delegate_taskPOST /api/a2a/delegateFire-and-forget dispatch to an agent
publish_eventPOST /publishInject a raw bus event
manage_cronPOST /api/ceremonies/*CRUD scheduled ceremonies
run_ceremonyPOST /api/ceremonies/:id/runManually trigger a ceremony
ToolAPI endpointPurpose
get_world_stateGET /api/world-stateFull system health snapshot (all domains)
get_projectsGET /api/projectsList registered projects
get_ci_healthGET /api/ci-healthCI pass rates across repos
get_pr_pipelineGET /api/pr-pipelineOpen PRs: total, conflicts, stale, failing CI
get_branch_driftGET /api/branch-driftDev vs main divergence per project
get_outcomesGET /api/world-stateGOAP action dispatch outcomes
get_incidentsGET /api/incidentsOpen security/operational incidents
get_ceremoniesGET /api/ceremoniesList ceremony definitions
get_cost_summaryGET /api/cost-summariesPer-agent/skill cost: tokens, duration, dollars
get_confidence_summaryGET /api/confidence-summariesPer-agent/skill calibration metrics
web_searchSearXNG /searchQuick web search (5 results)
ToolAPI endpointPurpose
manage_boardPOST /api/board/features/*Create or update board features
create_github_issuePOST /api/github/issuesFile GitHub issues on managed repos
report_incidentPOST /api/incidentsFile a security/operational incident
propose_config_changePOST /api/config-change/proposePropose YAML changes (goals, actions, agent configs) — requires human approval via Discord
ToolAPI endpointPurpose
reactPOST /api/discord/reactAdd emoji reaction to triggering message
send_updatePOST /api/discord/progressSend progress update during long work
msg_operatorPOST /api/operator/messageDirect message to human operator with urgency
ToolAPI endpointPurpose
discord_server_statsGET /api/discord/server-statsServer stats: members, channels, roles
discord_list_channelsGET /api/discord/channelsList all channels
discord_create_channelPOST /api/discord/channels/createCreate a channel
discord_sendPOST /api/discord/sendSend a message to a channel
discord_list_membersGET /api/discord/membersList server members

All LLM calls route through LiteLLM at LLM_GATEWAY_URL (or OPENAI_BASE_URL). The executor creates a ChatOpenAI instance with the gateway as baseURL and OPENAI_API_KEY for auth. Model aliases (e.g. claude-sonnet-4-6) are resolved by the gateway.

correlationId from the bus message is propagated through the LangGraph invocation. When LANGFUSE_* env vars are set, the LangChain callback handler traces every LLM call and tool invocation to Langfuse.

Use DeepAgentExecutor for any agent that should run inside the workstacean process with direct access to bus tools. This is the right choice for most agents.

Use A2A instead when the agent lives in a separate service (Quinn, protoMaker team, protoContent) or needs its own resource isolation.