Skip to content

Commit bf0d50c

Browse files
committed
Updated README to reflect automation changes.
1 parent 26f8630 commit bf0d50c

File tree

1 file changed

+35
-58
lines changed

1 file changed

+35
-58
lines changed

README.md

Lines changed: 35 additions & 58 deletions
Original file line numberDiff line numberDiff line change
@@ -23,44 +23,46 @@ All pattern implementations have been:
2323

2424
```text
2525
python-design-pattern-rag/
26-
├── chunks/ # All pattern code chunks in Markdown format
26+
├── chunks/ # All pattern code chunks in Markdown format
2727
│ ├── builder_Builder.md
2828
│ ├── factory_SimpleFactory.md
2929
│ └── ...
30-
├── docs/ # All pattern code chunks in Markdown format
31-
│ ├── builder_Builder.html
32-
│ ├── factory_SimpleFactory.html
30+
├── docs/ # All pattern code chunks in Markdown format
31+
│ ├── builder_Builder.md
32+
│ ├── factory_SimpleFactory.md
33+
│ ├── index.md
3334
│ └── ...
34-
├── patterns/ # All pattern code examples
35-
│ ├── creational/ # Creational patterns (e.g. Builder)
35+
├── patterns/ # All pattern code examples
36+
│ ├── creational/ # Creational patterns (e.g. Builder)
3637
│ | ├── abstract_factory.py
3738
│ | ├── builder.py
3839
│ | └── ...
39-
│ ├── structural/ # Structural patterns (e.g. Factory)
40+
│ ├── structural/ # Structural patterns (e.g. Factory)
4041
│ | ├── adapter.py
4142
│ | ├── decorator.py
4243
│ | └── ...
43-
│ └── behavioral/ # Behavioral patterns (e.g. Observer)
44+
│ └── behavioral/ # Behavioral patterns (e.g. Observer)
4445
│ ├── observer.py
4546
│ ├── memento.py
4647
│ └── ...
47-
├── ollama/ # Ollama related files
48-
│ ├── ModelFile # Modelfile for Ollama
49-
| └── README.md # Instructions on configuration for Ollama
50-
├── summary_index.json # Indexed metadata + summaries for each chunk
51-
├── rag_chunker.py # Script to chunk + enhance Python source files
52-
├── chunk_all_patterns.py # Script to chunk all patterns in `patterns/`
53-
├── summary_index_generator.py # Script to extract summary metadata from chunks
48+
├── ollama/ # Ollama related files
49+
│ ├── lesson-planner.ModelFile # Modelfile for Ollama
50+
│ ├── pattern-rag-gen.ModelFile # Modelfile for Ollama
51+
| └── README.md # Instructions on configuration for Ollama
52+
├── summary_index.json # Indexed metadata + summaries for each chunk
53+
├── rag_chunker.py # Script to chunk + enhance Python source files
54+
├── chunk_all_patterns.py # Script to chunk all patterns in `patterns/`
55+
├── summary_index_generator.py # Script to extract summary metadata from chunks
5456
└── README.md
5557
```
5658

5759
---
5860

5961
## 💡 Features
6062

61-
- ✂️ **File-Level Chunking**: Related classes/functions in each `.py` file are preserved as a single chunk
62-
- 🧠 **Ollama Integration**: Enhancements use [Falcon 3](https://ollama.com/library/falcon3) or other local models to add docstrings + summaries
63-
- 🗃️ **Front Matter Metadata**: Every chunk includes pattern name, file source, and identifiers for easy indexing
63+
- 🏫 **Generated Examples of Python Patterns**: Each file is a complete example of a python pattern. See the [patterns](patterns/) folder.
64+
- 🏫 **Educational Documentation**: Each python pattern has a generated lesson plan for easy learning and understanding. [Docs](https://taggedzi.github.io/python-design-pattern-rag/)
65+
- 📦 **RAG File Generation**: Files in the `chunks/` are enhanced with docstrings and summaries and formatted to be consumed by RAG systems.
6466
- 🔍 **Summary Index**: Machine-readable JSON index to power GUIs or search
6567

6668
---
@@ -109,7 +111,7 @@ Use the `summary_index.json` to:
109111
- ✅ Command
110112
- ✅ Facade
111113

112-
> New patterns can be added by running `rag_chunker.py` on new source files.
114+
> New patterns can be added in the `patterns` folder. Then running `invoke build-all` in the root directory of this repo will generate all the Docs, Chunks, and summary_index.json file. Please note EVERY time you run a build comman it will generate all the docs and chunks from scratch using a local LLM so each time the documents for all files will be slightly different. Please only commit files that are relevant to the pattern you're adding. Despite the large amount of automation there is still a lot of manual work involved in building the docs and chunks. Any commits that modify all the files will probably be denied.
113115
114116
---
115117

@@ -127,65 +129,40 @@ Contributions are welcome! You can:
127129

128130
Open issues or pull requests for improvements.
129131

130-
## Setup
132+
## Setup if you want to contribute or build RAG files yourself
131133

132134
1. Verify you have Python and pip installed. The project runs on python Python 3.10+ and pip. See [Python.org](https://www.python.org/) for installation instructions.
133135

134-
2. Use git to clone this repository. `git clone https://github.com/taggedzi/python-design-pattern-rag.git` or download the zip archive and extract it to your desired location.
135-
136-
3. Navigate to the project root directory and run `pip install -r requirements.txt`.
136+
2. Install Ollama and run it locally. Files can be downloaded from [ollama.com](https://ollama.com/download) for thier download options.
137137

138-
4. Install Ollama and run it locally. Files can be downloaded from [ollama.com](https://ollama.com/download) for thier download options.
138+
3. Use git to clone this repository. `git clone https://github.com/taggedzi/python-design-pattern-rag.git` or download the zip archive and extract it to your desired location.
139139

140-
5. Download the `falcon3:7b` model locally. See [Falcon 3](https://ollama.com/library/falcon3) for more information.
140+
4. Navigate to the project root directory and run `invoke venv` to setup the virtial environment, pull down dependancies, and get your envionment ready to go.
141141

142-
6. Use Ollama to create the custom model locally. See [ollama/README.md](./ollama/README.md) for more information.
143-
144-
7. To build ALL all the Markdown files run:
142+
5. To build ALL all the lessons and index:
145143
```bash
146-
python chunk_all_patterns.py
144+
invoke build-lessons
147145
```
148146

149-
8. To build a single file run:
147+
6. To build all the RAG files:
150148
```bash
151-
python rag_chunker.py ./patterns/<type>/<pattern>.py chunks --enhance
149+
invoke build-chunks
152150
```
153151

154-
---
155-
156-
## 🚀 Scripts
157-
158-
### `rag_chunker.py`
159-
160-
- Chunk Python files into `.md`
161-
- Optionally enhance using a local Ollama model
162-
163-
**Usage:**
164-
165-
```bash
166-
python rag_chunker.py ./patterns/<type>/<pattern>.py ./chunks --enhance
167-
```
168-
169-
For more information on this script, please refer to the source code, or call the script itself with the `--help` option.
170-
171-
### `summary_index_generator.py`
172-
173-
- Generate the `summary_index.json` from your `.md` chunks folder.
174-
175-
**Usage:**
176-
177-
```bash
178-
python summary_index_generator.py ./chunks ./summary_index.json
179-
```
152+
7. To build everything:
153+
```bash
154+
invoke build-all
155+
```
180156

181157
## 🙏 Acknowledgments
182158

183-
This project was created and maintained by Matthew Craig with assistance from OpenAI's ChatGPT (powered by GPT-4). Contributions from the AI included scaffolding, documentation, and refinement recommendations.
159+
This project was created and maintained by Matthew Craig (TaggedZi) with assistance from OpenAI's ChatGPT (powered by GPT-4). Contributions from the AI included scaffolding, documentation, and refinement recommendations.
184160

185161
This project also relies on:
186162

187163
- [Ollama](https://ollama.com) for running local LLMs
188164
- [Falcon 3](https://ollama.com/library/falcon3) by [TII](https://www.tii.ae/ai-and-digital-science) for AI-based contributions including scaffolding, documentation, and refinement recommendations.
165+
- [Deepseek Coder](https://ollama.com/library/deepseek-coder) by DeepSeek for AI-based contributsions producing the lesson files.
189166

190167
## 📄 License
191168

0 commit comments

Comments
 (0)