Skip to content

Rename agent-cascade command to live and add deepagents brain#237

Merged
alexkroman merged 1 commit into
mainfrom
claude/stoic-ritchie-g97bvu
Jun 18, 2026
Merged

Rename agent-cascade command to live and add deepagents brain#237
alexkroman merged 1 commit into
mainfrom
claude/stoic-ritchie-g97bvu

Conversation

@alexkroman

Copy link
Copy Markdown
Collaborator

Renames the assembly agent-cascade command to assembly live and replaces its simple LLM completion backend with a deepagents-powered graph that can transparently use tools mid-conversation (web search, URL fetch, AssemblyAI docs).

Key changes

  • Command rename: agent-cascadelive throughout the CLI, help text, examples, and tests
  • New brain module (aai_cli/agent_cascade/brain.py): Implements the deepagents graph backend with:
    • build_system_prompt(): Appends tool guidance to the user's persona
    • build_live_tools(): Assembles read-only toolset (fetch, web search if keyed, docs)
    • build_graph(): Compiles the deepagents graph with the gateway model
    • build_completer(): Returns a per-turn completion function that strips the cascade's system message before invoking the graph
    • Helper functions to extract spoken text from tool-using agent replies
  • Model enhancements (aai_cli/code_agent/model.py): Extended build_model() to accept max_tokens and extra parameters, threading cascade config through to the gateway model
  • Engine integration (aai_cli/agent_cascade/engine.py): Switched from aai_cli.core.llm.complete() to brain.build_completer() for the LLM leg
  • Comprehensive tests (tests/test_agent_cascade_brain.py): Unit tests for the brain module driving the real deepagents graph against a fake chat model (no network)
  • Updated snapshots: Help text and command references reflect the new live name and updated agent description

Implementation notes

  • The deepagents graph is the only network seam; build_completer() accepts an injected graph for testability
  • Tools are auto-approved (no keyboard confirmation) since a spoken turn can't pause
  • Web search is optional (present only when TAVILY_API_KEY is set); docs MCP is best-effort
  • The cascade's system message is stripped before graph invocation since the graph owns its own system prompt
  • Tool-using turns may end in empty AIMessages (tool-call requests); reply extraction scans backward for the last message with spoken text

https://claude.ai/code/session_01Hiovdq7aoXtbfg9juPzwQa

…ssembly live`

The cascade's LLM leg is now a deepagents graph (web search, URL fetch, and
AssemblyAI docs tools) instead of a single completion, so a spoken turn can
transparently use tools — a "talk to Gemini Live" experience. Tools are
read-only and auto-approved (a voice turn can't pause for keyboard approval),
and the system prompt keeps replies short and speakable for low latency.

The command is renamed from `agent-cascade` to `live`. The internal slice keeps
its `agent_cascade` name; only the user-facing command, help text, examples,
docs, and the show-code teaching snippet change. `assembly agent`'s help now
says it uses the Voice Agent API to distinguish the two.

- aai_cli/agent_cascade/brain.py: build the gateway-bound deepagents graph and a
  stateless per-turn completer; the graph is the only network seam, so the
  wiring is unit-tested against a fake graph / fake chat model.
- code_agent/model.build_model gains max_tokens + extra (extra_body) so the
  cascade's --max-tokens/--llm-config thread through; the coding agent's call is
  unchanged.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Hiovdq7aoXtbfg9juPzwQa
@alexkroman alexkroman added this pull request to the merge queue Jun 18, 2026
Merged via the queue into main with commit e3c832d Jun 18, 2026
19 checks passed
@alexkroman alexkroman deleted the claude/stoic-ritchie-g97bvu branch June 18, 2026 04:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants