Project Showcase

LangChain DeepAgent

Production-Ready AI Agent with Specialized Skills

A FastAPI service powering a LangChain DeepAgent backed by Ollama llama3.2:3b. Features four specialized skills for complex reasoning tasks, SSE streaming for real-time responses, Redis rate limiting, and multi-turn session memory.

Tech Stack

FastAPILangGraphLangChainOllamaRedisPythonDockerSSE

Key Features

4 Specialized Skills

Think (reasoning), Plan (task breakdown), Web Search (DuckDuckGo), Write Report (structured output). Each skill has its own SKILL.md instruction file.

Real-Time Streaming

Server-Sent Events (SSE) streaming for live agent responses. Watch the agent think and execute in real-time.

Session Memory

Multi-turn conversation support with context preservation. The agent remembers previous interactions within a session.

Rate Limiting

Redis-based rate limiting (10 requests/60s per IP) with health checks and graceful degradation.

Architecture

FastAPI with middleware stack (CORS, Logging, RateLimiter)
LangGraph for orchestrating agent workflows
ChatOllama with llama3.2:3b for local LLM inference
4 specialized tools with SKILL.md instruction files
Redis for rate limit counters and session storage
SSE streaming for real-time client updates

Diagrams

LangChain DeepAgent architecture
FastAPI fronts a LangGraph state machine that routes to four specialised skills (think, plan, web_search, write_report) and calls Ollama llama3.2:3b locally. Redis handles rate-limiting and multi-turn session memory.
DeepAgent request and SSE streaming flow
A single request streams back as a sequence of SSE events — thought, action, observation, final — while Redis enforces per-IP rate limits and appends each turn to session memory.

Real-Time Streaming

SSE Stream Example
Agent reasoning stream...
data: {"type": "thought", "content": "Analyzing the query..."}
data: {"type": "action", "tool": "web_search", "input": "latest AI trends 2024"}
data: {"type": "observation", "content": "Found 5 relevant sources..."}
data: {"type": "thought", "content": "Synthesizing information..."}
data: {"type": "final", "content": "Here's what I found..."}

4 Specialized Skills

1

think

Reasoning skill for complex problem analysis

Break down the problem into steps...
2

plan

Task breakdown and execution planning

Create a step-by-step plan to...
3

web search

DuckDuckGo search for real-time information

Search for latest research on...
4

write report

Structured report generation

Generate a comprehensive report...

Impact

Executes complex multi-step tasks autonomously with observable reasoning steps and verifiable outputs.

4

Specialized Skills

Real-time

SSE Streaming

Local

LLM with Ollama