Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion examples/chat-apps/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ Interactive multi-agent chat applications with Streamlit UI for testing AgentQ o
|-----|---------|-------------|
| [`support-bot/`](support-bot/) | **Router / Dispatcher** | Customer support bot that routes questions to specialist agents (Billing, Technical, FAQ). Demonstrates branching trace topology. |
| [`research-assistant/`](research-assistant/) | **Sequential Pipeline** | Research assistant that flows queries through Researcher β†’ Analyzer β†’ Writer agents. Demonstrates linear trace chains. |
| [`code-review-assistant/`](code-review-assistant/) | **Hierarchical Delegation** | Code review assistant where a Manager delegates to Security, Style, and Logic reviewer agents. Demonstrates parent-child trace hierarchy. |

## Prerequisites

Expand Down Expand Up @@ -56,7 +57,11 @@ examples/chat-apps/
β”‚ β”œβ”€β”€ README.md
β”‚ β”œβ”€β”€ requirements.txt
β”‚ └── main.py
└── research-assistant/
β”œβ”€β”€ research-assistant/
β”‚ β”œβ”€β”€ README.md
β”‚ β”œβ”€β”€ requirements.txt
β”‚ └── main.py
└── code-review-assistant/
β”œβ”€β”€ README.md
β”œβ”€β”€ requirements.txt
└── main.py
Expand Down
72 changes: 72 additions & 0 deletions examples/chat-apps/code-review-assistant/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
# Code Review Assistant β€” Hierarchical Delegation Pattern

A code review assistant where a Manager agent delegates to specialist reviewer agents. Demonstrates **hierarchical parent-child trace topology** β€” the Manager is the parent span, each reviewer is a child span with its own tool + LLM sub-spans.

## Architecture

```
User Pastes Code
β”‚
β–Ό
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚ Manager β”‚ ← Orchestrates the review, consolidates findings
β”‚ Agent β”‚
β””β”€β”€β”¬β”€β”€β”€β”¬β”€β”€β”€β”¬β”€β”€β”€β”˜
β”‚ β”‚ β”‚
β–Ό β–Ό β–Ό
β”Œβ”€β”€β”€β”€β”β”Œβ”€β”€β”€β”€β”β”Œβ”€β”€β”€β”€β”
β”‚ πŸ”’ β”‚β”‚ 🎨 β”‚β”‚ 🧠 β”‚
β”‚Sec.β”‚β”‚Sty.β”‚β”‚Log.β”‚
β”‚Rev.β”‚β”‚Rev.β”‚β”‚Rev.β”‚
β””β”€β”€β”€β”€β”˜β””β”€β”€β”€β”€β”˜β””β”€β”€β”€β”€β”˜
β”‚ β”‚ β”‚
β””β”€β”€β”€β”Όβ”€β”€β”€β”˜
β–Ό
Consolidated
Report
```

Each reviewer runs its own static analysis tools and LLM-based code inspection, all appearing as child spans under the Manager in AgentQ traces.

## Run

```bash
# Create a virtual environment
python -m venv .venv && source .venv/bin/activate

# Install dependencies
pip install -r requirements.txt

# Start the app
streamlit run main.py
```

Then open `http://localhost:3000` to see traces in the AgentQ dashboard.

## What to Try

- **Code with `eval()` or SQL queries** β†’ Security reviewer flags injection/execution risks
- **Code with hardcoded passwords** β†’ Security reviewer flags credential exposure
- **Code with classes or complex imports** β†’ Style reviewer provides specific guidance
- **Code with nested if/else** β†’ Logic reviewer flags conditional complexity
- **Code with loops** β†’ Logic reviewer analyzes efficiency and termination
- **Any Python code** β†’ All three reviewers provide a general review

Use the **"Show individual reviewer reports"** expander to see each specialist's detailed findings alongside their tool outputs.

## Trace Topology

```
session (conversation)
└── manager-agent
β”œβ”€β”€ security-reviewer
β”‚ β”œβ”€β”€ static-analysis-scan (tool)
β”‚ └── analyze-security (LLM)
β”œβ”€β”€ style-reviewer
β”‚ β”œβ”€β”€ lint-check (tool)
β”‚ └── analyze-style (LLM)
β”œβ”€β”€ logic-reviewer
β”‚ β”œβ”€β”€ complexity-analysis (tool)
β”‚ └── analyze-logic (LLM)
└── synthesize-report (LLM)
```
Loading
Loading