@@ -15,55 +15,189 @@ This repository provides:
15
15
16
16
### Building Blocks
17
17
18
- - ** Augmented LLM** : Basic LLM integration with retrieval, tools, and memory
19
- - ** Tool Integration** : Patterns for designing and implementing LLM tools
18
+ - ✅ ** Augmented LLM** : Basic LLM integration with retrieval, tools, and memory
19
+ - Web search, calculator, and weather tools
20
+ - Memory management
21
+ - Tool integration framework
20
22
21
23
### Workflows
22
24
23
- - ** Prompt Chaining** : Sequential LLM calls with intermediate processing
24
- - ** Routing** : Input classification and specialized handling
25
- - ** Parallelization** : Concurrent LLM processing with sectioning and voting
26
- - ** Orchestrator-Workers** : Dynamic task decomposition and delegation
27
- - ** Evaluator-Optimizer** : Iterative improvement through feedback loops
25
+ - ✅ ** Prompt Chaining** : Sequential LLM calls with intermediate processing
26
+
27
+ - Text analysis example
28
+ - Chain building and execution
29
+ - Context management
30
+
31
+ - ✅ ** Routing** : Input classification and specialized handling
32
+
33
+ - Support ticket routing example
34
+ - Dynamic route selection
35
+ - Fallback handling
36
+
37
+ - ✅ ** Parallelization** : Concurrent LLM processing with sectioning and voting
38
+
39
+ - Content moderation example
40
+ - Multiple voting strategies
41
+ - Result combination
42
+
43
+ - ✅ ** Orchestrator-Workers** : Dynamic task decomposition and delegation
44
+
45
+ - Document processing example
46
+ - Task distribution
47
+ - Worker management
48
+
49
+ - ✅ ** Evaluator-Optimizer** : Iterative improvement through feedback loops
50
+ - Code optimization example
51
+ - Multiple optimization strategies
52
+ - Progress tracking
28
53
29
54
### Agents
30
55
31
- - ** Autonomous Agents** : Self-directed systems with planning and execution
32
- - ** Domain-Specific Agents** : Implementations for customer support, coding, etc.
56
+ - ✅ ** Autonomous Agents** : Self-directed systems with planning and execution
57
+
58
+ - Research assistant example
59
+ - Dynamic planning
60
+ - Tool utilization
61
+
62
+ - ✅ ** Domain-Specific Agents** : Implementations for specialized domains
63
+ - Medical diagnosis example
64
+ - Domain knowledge integration
65
+ - Constraint enforcement
33
66
34
67
## Getting Started
35
68
36
- Each pattern includes:
69
+ ### Prerequisites
37
70
38
- - Architectural overview
39
- - Implementation examples using different LLM providers:
40
- - Anthropic Claude
41
- - OpenAI GPT
42
- - Google Vertex AI
43
- - Azure OpenAI
44
- - Test cases and example outputs
45
- - Best practices and common pitfalls
71
+ - Python 3.8+
72
+ - API keys for the LLM provider(s) you want to use
73
+ - Git for version control
46
74
47
- ## Usage
75
+ ### Installation
48
76
49
- Navigate to the specific pattern you're interested in :
77
+ 1 . Clone the repository :
50
78
51
79
``` bash
52
- examples/
53
- workflows/prompt-chaining/ # For prompt chaining examples
54
- agents/autonomous-agent/ # For autonomous agent examples
80
+ git clone https://github.com/coderplex-tech/building-with-llms.git
81
+ cd building-with-llms
55
82
```
56
83
57
- Each example contains a standalone implementation that you can run with your API keys.
84
+ 2 . Create and activate a virtual environment:
58
85
59
- ## Prerequisites:
86
+ ``` bash
87
+ python -m venv venv
88
+ source venv/bin/activate # On Windows: venv\Scripts\activate
89
+ ```
60
90
61
- - Python 3.8+
62
- - API keys for the LLM provider(s) you want to use
91
+ 3 . Install dependencies:
92
+
93
+ ``` bash
94
+ pip install -r requirements.txt
95
+ ```
96
+
97
+ 4 . Set up environment variables:
98
+
99
+ ``` bash
100
+ cp .env.example .env
101
+ # Edit .env with your API keys and configuration
102
+ ```
103
+
104
+ ### Running Examples
105
+
106
+ Each pattern includes standalone examples that demonstrate its usage. Here's how to run them:
107
+
108
+ 1 . ** Building Blocks** :
109
+
110
+ ``` bash
111
+ # Augmented LLM example
112
+ python -m building-block.augmented-llm.examples.basic_usage
113
+ ```
114
+
115
+ 2 . ** Workflows** :
116
+
117
+ ``` bash
118
+ # Prompt Chaining
119
+ python -m workflows.prompt-chaining.examples.text_analysis
120
+
121
+ # Routing
122
+ python -m workflows.routing.examples.support_routing
123
+
124
+ # Parallelization
125
+ python -m workflows.parallelization.examples.content_moderation
126
+
127
+ # Orchestrator-Workers
128
+ python -m workflows.orchestrator-workers.examples.document_processing
129
+
130
+ # Evaluator-Optimizer
131
+ python -m workflows.evaluator-optimizer.examples.code_optimization
132
+ ```
133
+
134
+ 3 . ** Agents** :
135
+
136
+ ``` bash
137
+ # Autonomous Agent
138
+ python -m agents.autonomous-agent.examples.research_assistant
139
+
140
+ # Domain-Specific Agent
141
+ python -m agents.domain-specific.examples.medical_assistant
142
+ ```
143
+
144
+ ### Directory Structure
145
+
146
+ ```
147
+ ├── building-block/
148
+ │ └── augmented-llm/ # Basic LLM integration
149
+ ├── workflows/
150
+ │ ├── prompt-chaining/ # Sequential processing
151
+ │ ├── routing/ # Input classification
152
+ │ ├── parallelization/ # Concurrent processing
153
+ │ ├── orchestrator-workers/ # Task decomposition
154
+ │ └── evaluator-optimizer/ # Iterative improvement
155
+ ├── agents/
156
+ │ ├── autonomous-agent/ # Self-directed systems
157
+ │ └── domain-specific/ # Specialized agents
158
+ ├── requirements.txt # Project dependencies
159
+ ├── .env.example # Example environment variables
160
+ └── README.md # This file
161
+ ```
162
+
163
+ ## Implementation Details
164
+
165
+ Each pattern is implemented with:
166
+
167
+ - Core classes and interfaces
168
+ - Example implementations
169
+ - Comprehensive documentation
170
+ - Unit tests (coming soon)
171
+ - Best practices and usage guidelines
172
+
173
+ ### Current Features
174
+
175
+ - Multiple LLM provider support (Anthropic, OpenAI, etc.)
176
+ - Async/await for efficient processing
177
+ - Type hints and Pydantic models
178
+ - Error handling and retries
179
+ - Detailed logging
180
+ - Configuration management
181
+
182
+ ### Coming Soon
183
+
184
+ - Additional examples for each pattern
185
+ - Integration tests
186
+ - Performance benchmarks
187
+ - CI/CD pipeline
188
+ - Docker containerization
189
+ - API documentation
63
190
64
191
## Contributing
65
192
66
- We welcome contributions! Please see our Contributing Guide for details.
193
+ We welcome contributions! Here's how you can help:
194
+
195
+ 1 . Fork the repository
196
+ 2 . Create a feature branch
197
+ 3 . Make your changes
198
+ 4 . Submit a pull request
199
+
200
+ Please ensure your code follows our style guide and includes appropriate tests and documentation.
67
201
68
202
## Why Native Implementations?
69
203
@@ -76,6 +210,17 @@ While frameworks like LangChain can be useful, we believe building directly with
76
210
77
211
## Resources
78
212
79
- - Architecture Decision Records
80
- - Pattern Documentation
81
- - Implementation Guides
213
+ - 📚 [ Pattern Documentation] ( ./docs )
214
+ - 🔧 [ Implementation Guides] ( ./guides )
215
+ - 📊 [ Architecture Decision Records] ( ./adr )
216
+ - 🧪 [ Example Collection] ( ./examples )
217
+
218
+ ## License
219
+
220
+ This project is licensed under the MIT License - see the [ LICENSE] ( LICENSE ) file for details.
221
+
222
+ ## Acknowledgments
223
+
224
+ - Thanks to all contributors
225
+ - Inspired by software architecture patterns and LLM best practices
226
+ - Built with modern Python async/await patterns
0 commit comments