Runnable Blueprints & Scaffolds
Root code-examples/

Production Code Scaffolds

11 tested, standalone engineering scaffolds and architectural blueprints demonstrating core AI engineering patterns — from multi-server MCP routing and LangGraph supervisors to Deep Agents composite backends and Docker GPU serving.

Total Blueprints11
Active Runnable7
Reference Designs4
Test Coverage100%
Active Runnable
Agent Runtimes
Python 3.10+ (uv/pip)
Deep Agent Minimal Harness Blueprint
Deep Agents SDK with DeltaChannel state and CompositeBackend

A standalone, runnable Python reference implementation demonstrating the core architecture of Deep Agents: compiling an agent graph with DeepAgentState, DeltaChannel bounding checkpoint growth to O(N), CompositeBackend virtual storage multiplexing (/workspace to disk, /scratch to ephemeral memory), and custom audit middleware.

Architecture Layers:
Agent RuntimeVirtual BackendState Layer
Prerequisites:
  • •Python 3.10+
  • •uv or pip
  • •Anthropic API Key (ANTHROPIC_API_KEY)
Terminal Run Command:click to select all
uv pip install -e . && python src/main.py
code-examples/deepagent-minimal-harness
Active Runnable
Protocol & Transport
Python 3.10+
Multi-Server MCP Hub Scaffold
Concurrent stdio and SSE transport routing across heterogeneous tool providers

A production-grade multi-server Model Context Protocol (MCP) client scaffold that concurrently orchestrates tools, resources, and prompt templates across multiple independent MCP servers over stdio and SSE transports.

Architecture Layers:
Transport LayerProtocol IngressMulti-Server Router
Prerequisites:
  • •Python 3.10+
  • •pip or uv
  • •Model Context Protocol SDK
Terminal Run Command:click to select all
pip install -e . && python src/main.py
code-examples/mcp-multi-server-hub
Active Runnable
Multi-Agent Systems
Python 3.10+ / Docker
DeerFlow 2.0 SuperAgent Reference Scaffold
Multi-agent supervisor, dynamic SKILL.md parsing, and Docker container sandbox harness

Clean Python reference scaffold demonstrating the core architectural patterns of ByteDance DeerFlow 2.0: LangGraph Pregel lead supervisor, declarative SKILL.md tool loader, Docker container isolation, and durable SQLite state checkpointer.

Architecture Layers:
SupervisorWorker ClusterSandbox IsolationState Checkpointer
Prerequisites:
  • •Python 3.10+
  • •Docker Engine running
  • •pip install -r requirements.txt
Terminal Run Command:click to select all
python -m pip install -r requirements.txt && python main.py
code-examples/deerflow-superagent-scaffold
Active Runnable
Autonomous Coding Agents
Python 3.10+ / Docker
Open-SWE Minimal Runner Scaffold
Autonomous SWE agent execution loop with Docker sandbox and file patch isolation

Autonomous software engineering agent runtime inspired by SWE-bench and OpenHands. Implements the core observe-think-act loop inside isolated containerized development environments with unified diff patching.

Architecture Layers:
Agent LoopExecution SandboxDiff Patch Engine
Prerequisites:
  • •Python 3.10+
  • •Docker Engine running
  • •Git installed
Terminal Run Command:click to select all
python src/main.py
code-examples/open-swe-minimal-runner
Architecture Blueprint
Retrieval & Search
Python 3.12+ / PostgreSQL
Production RAG Pipeline (FastAPI + pgvector)
Hybrid retrieval-augmented generation with reciprocal rank fusion and citation verification

Enterprise RAG reference architecture featuring FastAPI, PostgreSQL with pgvector for HNSW vector indexing, BM25 keyword search, reciprocal rank fusion (RRF), and sentence-level citation verification.

Architecture Layers:
Ingress GatewayVector StorageRRF Fusion EngineCitation Guardrail
Prerequisites:
  • •Python 3.12+
  • •PostgreSQL 16+ with pgvector extension
  • •OpenAI or Cohere API Key
Terminal Run Command:click to select all
pip install -r requirements.txt && uvicorn main:app --reload
code-examples/rag-pipeline
Active Runnable
Web Ingress & Streaming
Node.js 18+ / Next.js 15
Next.js 15 Streaming Chat API
High-throughput token streaming with Vercel AI SDK, Server-Sent Events, and backpressure

Production Next.js 15 App Router streaming chat endpoint utilizing the Vercel AI SDK. Features robust backpressure handling, client-side abort controllers, tool calling chunk parsing, and real-time token rendering.

Architecture Layers:
Edge IngressStreaming TransportToken Stream Parser
Prerequisites:
  • •Node.js 18+
  • •npm / pnpm / yarn
  • •OpenAI or Anthropic API Key
Terminal Run Command:click to select all
npm install && npm run dev
code-examples/streaming-api
Active Runnable
Inference & Model Serving
Docker / NVIDIA GPU
Dockerizing Ollama for GPU Inference
Containerized local LLM serving with NVIDIA Container Toolkit passthrough and health checks

Turnkey Docker Compose orchestration for self-hosting open-weight models (Llama 3.2, DeepSeek-R1, Qwen 2.5) with full NVIDIA GPU passthrough, persistent volume storage, and automated health checks.

Architecture Layers:
Container OrchestrationGPU Hardware PassthroughInference Runtime
Prerequisites:
  • •Docker Engine 24+
  • •Docker Compose v2
  • •NVIDIA Container Toolkit (nvidia-smi)
Terminal Run Command:click to select all
docker compose up -d && docker compose exec ollama ollama run llama3.2
code-examples/docker-ollama
Active Runnable
Multi-Agent Systems
Python 3.10+
LangGraph Supervisor Pattern
Multi-agent coordination with specialized researcher and coder subagents plus SQLite checkpointing

Reference implementation of the supervisor multi-agent architecture in LangGraph. A top-level supervisor delegates incoming user requests between a research agent and a coding agent, with SQLite checkpoint persistence.

Architecture Layers:
Supervisor NodeSubagent WorkersSQLite State Checkpointer
Prerequisites:
  • •Python 3.10+
  • •pip / uv
  • •OpenAI or Gemini API Key
Terminal Run Command:click to select all
pip install -r requirements.txt && python main.py
code-examples/langgraph-supervisor
Architecture Blueprint
Data Systems & Embeddings
Python 3.12+ / pgvector
Vector Search & Hybrid Retrieval
HNSW and IVFFlat index tuning with pgvector and dense embedding generation

Deep-dive blueprint on vector indexing mechanics. Demonstrates generating dense embeddings, benchmarking HNSW vs. IVFFlat index build times and recall@k, and executing hybrid cosine + lexical queries.

Architecture Layers:
Embedding PipelineVector Index EngineSimilarity Search
Prerequisites:
  • •Python 3.12+
  • •PostgreSQL with pgvector
  • •NumPy / Sentence-Transformers
Terminal Run Command:click to select all
python search.py
code-examples/vector-search
Architecture Blueprint
Agentic Systems
Python 3.12+ / LangGraph
Multi-Step Agent Workflow State Machine
Deterministic cyclic control flow, tool calling, and conditional branching in LangGraph

Architectural blueprint for mission-critical agent workflows. Demonstrates explicit cyclic state machines, conditional routing edges, error recovery loops, and conversational turn persistence.

Architecture Layers:
State MachineControl Flow RouterMemory Persistence
Prerequisites:
  • •Python 3.12+
  • •Google Gemini or Anthropic API Key
  • •LangGraph SDK
Terminal Run Command:click to select all
pip install -r requirements.txt && python workflow.py
code-examples/agent-workflow
Architecture Blueprint
Distributed Agents
Python 3.11+ / LangGraph
Hierarchical Deep Agent Cluster
Distributed multi-agent cluster with delegated sub-graphs and isolated thread state

Scaled enterprise blueprint implementing a hierarchical agent cluster. Features a root orchestrator coordinating partitioned sub-agent clusters, boundary checkpointers, and distributed event channels.

Architecture Layers:
Cluster TopologyDistributed Event ChannelsPartitioned Checkpointing
Prerequisites:
  • •Python 3.11+
  • •pip / uv
  • •Redis or PostgreSQL for distributed checkpointers
Terminal Run Command:click to select all
pip install -r requirements.txt && python cluster.py
code-examples/langgraph-deep-agent-cluster