Skip to content

[Epic] Deep Agent migration: review findings & hardening plan #49

Open

Description

@stavp-star

Tracking epic for the architecture and code review of feature/deep-agent-updated: migrating the LangGraph workflow agent (agent/src/agent) to a deepagents-based agent (agent/src/deep_agent).

Headline findings

  1. The skills and AGENTS.md never load. All four skills and the memory file are silently ignored, on every machine ([Deep Agent] Skills and AGENTS.md memory are never loaded (hardcoded paths + StateBackend + wrong skill source layout) #34).
  2. The agent runs arbitrary LLM SQL with no read-only guard, and the LIMIT safety net is easy to bypass ([Deep Agent] Enforce read-only SQL, AST-level LIMIT and safe identifiers in Trino tools #35).
  3. enrich_sql_filters makes the model re-type the whole catalog as a tool argument ([Deep Agent] enrich_sql_filters forces the LLM to re-emit the full catalog as an argument and drops tracing config #36).
  4. The deep agent has no Langfuse tracing ([Deep Agent] Add end-to-end Langfuse tracing (callbacks, nested tool config, span metadata, scores) #37).
  5. There are no tests and no eval harness, so there is no evidence yet that the migration improves accuracy ([Deep Agent] Unit tests + offline eval harness (legacy graph vs deep agent) as the migration go/no-go gate #44).

Suggested order

P0: fix before any further evaluation (current measurements don't reflect the intended design)

P1: required for production parity

P2: quality and modernization

Migration exit criteria


🤖 Generated with Claude Code

Activity

  1. stavp-star commented on Oct 20, 2026

    @stavp-star
    CollaboratorAuthor

    Implementation: 15 stacked PRs (merge top to bottom)

    PR 1 targets feature/deep-agent-updated; each later PR targets the one above it, and GitHub retargets it automatically as you merge.

    # PR Closes Summary
    1 #50 #46 CLI entry point (uv run deep-agent), committed logs and scratch files removed
    2 #51 #34 Skills and AGENTS.md actually load (they never did)
    3 #52 #35 Read-only SQL guard, AST-level LIMIT, safe identifiers
    4 #53 #39 Trino errors classified from errorName, with line/column
    5 #54 #45 One {ok, data, error} tool envelope; MCP errors surfaced
    6 #55 #38 Request-scoped runtime context (connection, capabilities, date)
    7 #56 #36 Catalog cached in state; enrichment traced again
    8 #57 #37 One Langfuse trace per run, span metadata, run scores
    9 #58 #41 Structured answer bound to executed SQL; rows come from Trino
    10 #59 #42 Loop bounds, tool trimming, connection reuse, metadata cache, deep-agent-bench
    11 #60 #40 Guidance fixes; prompt + memory −72% tokens; CI lint
    12 #61 #48 Subagents and Langfuse-managed prompts
    13 #62 #47 Utils-Server tools via Jarvis Registry MCP
    14 #63 #44 Execution-accuracy eval harness (deep-agent-eval --gate) and CI
    15 #64 #43 Deep agent behind chat_with_agent: engine switch, Postgres threads, streaming, HITL

    Suite on #64: agent 434 passed, 3 skipped; backend 14 passed.

    Needs you / infra

    • Add the repo secret PYTHON_CORE_UTILS_TOKEN so CI ([Deep Agent 14/15] Execution-accuracy eval harness (deep vs legacy) + CI (#44) #63) can install the private dependency
    • Rotate JEEN_API_KEY / JEEN_METADATA_MCP_KEY: real-looking defaults are committed in agent/src/agent/config.py (predates this work)
    • Live runs once the LLM, Jeen MCP and Trino are reachable: deep-agent-bench, then deep-agent-eval with an expert-verified gold set. Only 2 of 10 seed items have (unverified) gold SQL.
    • Push the prompts to Langfuse (agent/scripts/sync_deep_agent_prompts.py --label staging) and approve the 5 Utils-Server tools in the registry
    • Set DEEP_AGENT_CHECKPOINT_DB_URL for durable threads in deployed environments

    🤖 Generated with Claude Code

  2. StavPonte11 commented on Oct 21, 2026

    @StavPonte11
    Owner

    Added 16/16: #66 (location-analyst subagent, closes #65), stacked on #64.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions