A comprehensive collection of examples demonstrating the implementation and usage of each pattern.
- Basic Usage
- Simple tool integration
- Memory usage
- Basic LLM interaction
- Text Analysis
- Multi-step text processing
- Context management
- Result aggregation
- Support Routing
- Ticket classification
- Handler selection
- Fallback management
- Content Moderation
- Parallel content checks
- Result voting
- Consensus building
- Document Processing
- Task decomposition
- Worker coordination
- Result aggregation
- Code Optimization
- Code improvement
- Multiple strategies
- Progress tracking
- Research Assistant
- Dynamic planning
- Tool utilization
- Goal achievement
- Medical Assistant
- Domain knowledge
- Constraint handling
- Specialized behaviors
- Python 3.8+
- Required API keys (see .env.example)
- Dependencies installed:
pip install -r requirements.txt
-
Copy environment template:
cp .env.example .env
-
Edit .env with your API keys:
ANTHROPIC_API_KEY=your_key_here # ... other keys as needed
Each example can be run directly using Python:
# Format:
python -m path.to.example
# Examples:
python -m building-block.augmented-llm.examples.basic_usage
python -m workflows.prompt-chaining.examples.text_analysis
python -m agents.autonomous-agent.examples.research_assistant
Each example provides clear output showing:
- Input processing
- Intermediate steps
- Final results
- Any errors or issues
- Follow the existing structure
- Include clear documentation
- Handle errors gracefully
- Add meaningful output
- Update this index
-
Basic
- Augmented LLM basic usage
- Simple prompt chaining
- Basic routing
-
Intermediate
- Content moderation
- Document processing
- Research assistant
-
Advanced
- Code optimization
- Medical diagnosis
- Multi-agent coordination
-
Tool Integration
- Web search
- Calculator
- Weather info
-
Memory Usage
- Conversation history
- Context management
- State tracking
-
Error Handling
- Input validation
- API errors
- Fallback strategies
-
Text Processing
- Analysis
- Summarization
- Classification
-
Code
- Optimization
- Review
- Generation
-
Healthcare
- Diagnosis
- Treatment planning
- Drug interaction