A production-grade monorepo portfolio of 10 progressive Agentic AI projects built on the LangChain / LangGraph / LangSmith / MCP stack. Designed as an industry-standard reference architecture covering single-agent ReAct loops, production RAG, cross-session memory, multi-agent supervisor hierarchies, human-in-the-loop (HITL) safety, Model Context Protocol (MCP) integrations, deep autonomous subagents, typed structured outputs, and automated evaluation harnesses.
The monorepo is architected around modular FastAPI agent services, a reusable Next.js 15 chat shell, and a shared Python infrastructure package (common) for model routing, streaming telemetry, and evaluation gates.
ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β apps/chat-ui (Next.js 15) β
β β’ Token-by-token SSE streaming β
β β’ Collapsible Tool Call Inspection Trees β
β β’ Direct Deep Links to LangSmith Traces β
βββββββββββββββββββββββββββββ¬βββββββββββββββββββββββββββββ
β HTTP POST (SSE stream)
βΌ
ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β FastAPI Agent Service (/agents/*) β
β β’ /v1/chat/completions (OpenAI-compatible) β
β β’ StateGraph Execution & Checkpointing β
β β’ Interrupt Handling & Resumption Endpoints β
βββββββββββββββ¬ββββββββββββββββββββββββββββ¬βββββββββββββββ
β β
ββββββββββββββββββ΄ββββββββββββββββ β
βΌ βΌ βΌ
βββββββββββββββββββββββββββββββ βββββββββββββββββββββββββββββ βββββββββββββββββββββββββββββββββ
β common.llm β β common.ui_bridge β β common.tracing β
β β’ Multi-provider routing β β β’ Typed SSE event codec β β β’ LangSmith telemetry setup β
β β’ OpenRouter / Ollama β β β’ token / tool / trace β β β’ Scoped project contexts β
ββββββββββββββββ¬βββββββββββββββ βββββββββββββββββββββββββββββ βββββββββββββββββ¬ββββββββββββββββ
β β
βΌ βΌ
βββββββββββββββββββββββββββββββ βββββββββββββββββββββββββββββββββ
β LLMs (Claude, GPT-4o, Llama)β β LangSmith Observability Platformβ
βββββββββββββββββββββββββββββββ βββββββββββββββββββββββββββββββββ
| Project | Pattern | Core Technologies | Eval & Observability | Status |
|---|---|---|---|---|
| P0: Foundation & Smoke | Shared Infra Validation | FastAPI, SSE Bridge, Next.js 15, LangSmith | Unit + integration smoke tests | β Completed |
| P1: ReAct Research Agent | Single-Agent Reasoning | create_react_agent, Tavily Search, OpenRouter |
30 multi-hop Q&A benchmark (94.7% recall) | β Completed |
| P2: Production RAG | Retrieval & Reranking | Semantic Chunking, Qdrant, Cohere Rerank | Faithfulness & Context-Precision evals | β³ Planned |
| P3: Conversational Memory | Multi-Tier State Store | LangGraph MemorySaver + PostgreSQL Store |
20 multi-turn recall benchmarks | β³ Planned |
| P4: Multi-Agent Supervisor | Hierarchical Orchestration | LangGraph Subgraphs, Command handoffs |
15 collaborative research tasks | β³ Planned |
| P5: HITL Approval Workflow | Human-in-the-Loop Safety | LangGraph interrupt(), Resumable Checkpoints |
10 destructive mutation scenarios | β³ Planned |
| P6: MCP Tool Server | Protocol-Driven Tooling | Python mcp SDK, langchain-mcp-adapters |
12 cross-tool workflow evaluations | β³ Planned |
| P7: Deep Research Agent | Long-Horizon Autonomy | Parallel Send API, Context Offloading |
LLM-as-a-Judge report rubrics | β³ Planned |
| P8: Structured-Output Agent | Typed Schema Extraction | Pydantic v2, Retry Prompt Injection | 30 malformed input edge cases | β³ Planned |
| P9: Eval & Observability | CI/CD Quality Gates | LangSmith evaluate(), Trajectory Matching |
Meta-evals against human labels | β³ Planned |
| P10: Production Capstone | Full-Stack Deployment | Docker, FastAPI, Rate Limiting, Sentry | Locust load tests + online evals | β³ Planned |
LearnAgenticAI/
βββ .github/
β βββ workflows/
β βββ ci.yml # Python (uv, ruff, mypy, pytest) + TypeScript (vitest, typecheck, lint)
β βββ openwiki-update.yml # Automated documentation synchronization
βββ agents/
β βββ P0-smoke/ # Smoke validation agent (FastAPI + LangChain)
β β βββ src/P0_smoke/ # Server and agent graph implementation
β β βββ tests/ # Unit and integration test suites
β β βββ pyproject.toml # Agent package definition
β βββ P1-react-agent/ # Autonomous ReAct research agent (Tavily + web reading)
β β βββ src/P1_react_agent/ # ReAct graph, prompts, and SSE bridge
β β βββ data/ # 30-question multi-hop eval dataset
β β βββ tests/ # Unit, integration, and eval test suites
β β βββ eval.py # Offline evaluation CLI benchmark
β β βββ pyproject.toml # Agent package definition
β βββ ... # P2 through P10 agent packages
βββ apps/
β βββ chat-ui/ # Next.js 15 chat shell with Tailwind CSS & Lucide icons
β βββ app/ # App Router pages and health routes
β βββ components/ # ChatWindow, ToolCallTree, TraceLink, MessageBubble
β βββ lib/ # API streaming client and TypeScript types
β βββ tests/ # Vitest test suite
βββ common/ # Shared Python workspace package
β βββ src/common/
β β βββ config.py # Pydantic BaseSettings environment configuration
β β βββ llm.py # Multi-model factory (OpenRouter, Ollama, OpenAI)
β β βββ tracing.py # LangSmith context manager and telemetry setup
β β βββ ui_bridge.py # Typed SSE event formatters (token, tool, trace)
β β βββ tools/ # Shared search, filesystem, and data tools
β βββ tests/ # Unit tests for shared infrastructure
βββ docker/
β βββ docker-compose.yml # Local Postgres (pgvector) and Qdrant services
β βββ .env.example # Docker environment templates
βββ docs/ # Architecture specifications and implementation plans
βββ scripts/
β βββ test.sh # Monorepo test runner (Python + TypeScript)
β βββ dev-up.sh # Bootstrap local Docker infrastructure
β βββ dev-down.sh # Tear down local Docker services
βββ pyproject.toml # uv monorepo workspace configuration
Route dynamically across LLM providers based on project load and reasoning requirements:
from common.llm import get_model
# High-reasoning agent model
model = get_model(project="P1-react-agent", task="reasoning")
# Cost-optimized evaluator model
eval_model = get_model(project="P2-rag", task="eval")Isolate project traces cleanly in LangSmith with automatic environment scoping:
from common.tracing import setup
# Automatically configures LANGSMITH_PROJECT="LearnAgenticAI/P1-react-agent"
with setup("P1-react-agent"):
response = agent.invoke({"messages": [...]})Format events predictably for consumer frontends:
from common.ui_bridge import to_sse
# Stream individual tokens
yield to_sse("token", {"delta": "Hello"})
# Stream tool start and completion telemetry
yield to_sse("tool_start", {"id": "call_1", "tool": "tavily_search", "args": {"query": "LangGraph"}})
yield to_sse("tool_end", {"id": "call_1", "result": "..."})
# Attach LangSmith trace URL
yield to_sse("trace_meta", {"run_id": "8f2a...", "project": "LearnAgenticAI/P1-react-agent"})# Clone the repository
git clone git@github.com:atandra2000/LearnAgenticAI.git
cd LearnAgenticAI
# Copy environment configuration files
cp .env.example .env
cp docker/.env.example docker/.env
cp apps/chat-ui/.env.example apps/chat-ui/.env.local
# Edit .env and supply your API keys:
# OPENROUTER_API_KEY=...
# LANGSMITH_API_KEY=...# Sync Python workspace packages
uv sync --all-packages --all-extras
# Install frontend dependencies
pnpm --dir apps/chat-ui install
# Start local backing services (PostgreSQL + Qdrant)
bash scripts/dev-up.shIn terminal 1 (Backend Agent):
cd agents/P0-smoke
uv run uvicorn P0_smoke.server:app --reload --port 8000In terminal 2 (Next.js Chat UI):
pnpm --dir apps/chat-ui devOpen http://localhost:3000 to interact with the agent.
The repository enforces strict typing, linting, and automated testing across both Python and TypeScript workspaces.
# Run the complete test suite (Python pytest + TypeScript vitest)
bash scripts/test.sh
# Python Linting & Formatting
uv run ruff check .
uv run ruff format --check .
# Python Static Type Analysis
uv run mypy common/src agents/P0-smoke/src
# TypeScript Typecheck & Linting
pnpm --dir apps/chat-ui typecheck
pnpm --dir apps/chat-ui lintDistributed under the MIT License. See LICENSE for more details.