Skip to content

Latest commit

 

History

4 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Agentic Design Patterns with LangChain

A practical learning repository for implementing agentic design patterns using LangChain framework.

Repository Structure

patterns/
├── reflection/          # ✅ Self-evaluation and improvement
├── planning/           # ✅ Task decomposition and sequential execution
├── routing/            # ✅ Query routing to specialized agents
├── parallelization/    # ✅ Concurrent task processing
├── tool_use/          # ✅ External tool integration
├── multi_agent/       # 🚧 Agent collaboration patterns
└── memory/            # 🚧 State and context management

config/               # LangChain configuration
examples/            # Complete implementations
tests/              # Pattern validation

Quick Start

  1. Install dependencies: pip install -r requirements.txt
  2. Set API key (optional): export OPENAI_API_KEY="your-key"
  3. Run examples: python examples/reflection_example.py
  4. Run tests: python -m pytest tests/

LangChain Integration

  • Chains - Structured prompt → LLM → output pipelines
  • Prompt Templates - Reusable, parameterized prompts
  • Modular LLMs - Easy switching between providers
  • Mock Support - Testing without API keys

Implemented Patterns

  • Reflection Pattern - LangChain-based self-evaluation
  • Prompt Chaining - Sequential prompt execution
  • Routing Pattern - Query classification and specialized routing
  • Parallelization Pattern - Concurrent task processing
  • Tool Use Pattern - External tool integration
  • 🚧 Multi-Agent Pattern - Coming soon
  • 🚧 Memory Pattern - Coming soon

Learning Path

  1. Start with Reflection pattern (patterns/reflection/)
  2. Try Prompt Chaining (patterns/planning/)
  3. Explore Routing (patterns/routing/)
  4. Learn Parallelization (patterns/parallelization/)
  5. Study LangChain chain composition
  6. Run examples with/without API keys
  7. Implement your own variations

Each pattern includes:

  • LangChain implementation
  • Configurable LLM support
  • Usage examples
  • Tests with mocks

About

A practical learning repository for implementing agentic design patterns using LangChain framework.

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages