CLAUDE.md
CLAUDE.mdCLAUDE.mdroot
Quality
73/100
Scores the file, not the repository.Length
649 words
22 headings · 5 code blocksRepository
42
— · pushed 237 days agoLast changed
3 days ago
First indexed 3 days ago.1# CLAUDE.md23This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.45## Project Overview67This is an educational workshop repository for building Retrieval-Augmented Generation (RAG) applications, used for the O'Reilly training course "Building Reliable RAG Applications: From PoC to Production". The workshop follows a progressive structure from basic to advanced RAG techniques.89## Workshop Structure10111. **Naive RAG** (`naive-rag/`) - Basic RAG implementation concepts122. **Naive RAG Challenges** - Identifying limitations and areas for improvement133. **Advanced RAG** (`advanced-rag/`) - Reranking and hybrid search techniques144. **SciFact Dataset** (`advanced-rag/scifact/`) - Advanced demonstrations using scientific data1516## Environment Setup1718This project uses [uv](https://docs.astral.sh/uv/) for dependency management.1920```bash21# Install uv (if not installed)22curl -LsSf https://astral.sh/uv/install.sh | sh2324# Install Python 3.11 and all dependencies25uv sync2627# Set environment variables in .env file28OPENAI_API_KEY=your_key_here29QDRANT_URL=your_qdrant_url_here30QDRANT_API_KEY=your_qdrant_api_key_here # For cloud setup only31COHERE_API_KEY=your_cohere_key_here # Optional, for advanced features32```3334## Running Notebooks3536Start Jupyter and run notebooks in order:3738```bash39uv run jupyter lab40```41421. `naive-rag/01-naive-rag.ipynb` - Basic RAG implementation432. `naive-rag/02-naive-rag-challenges.ipynb` - Exploring limitations443. `advanced-rag/01-advanced-rag-rerank.ipynb` - Advanced techniques with reranking4546All notebooks automatically detect Qdrant setup (cloud vs local) based on environment variables.4748## Data Setup Commands4950Two setup options available:5152**Option A: Qdrant Cloud (Recommended)**53```bash54uv run python scripts/ingest_to_qdrant_cloud.py55```5657**Option B: Local Docker Setup**58```bash59docker run -d -p 6333:6333 -p 6334:6334 qdrant/qdrant:v1.13.260uv run python scripts/ingest_to_qdrant_cloud.py61```6263The ingestion script loads 61 Wikipedia articles, creates 1,210 chunks (300 chars with 50 char overlap), and uploads to Qdrant.6465## Key Architecture Components6667### Data Processing Pipeline68- **Raw Data**: Wikipedia articles fetched via `scripts/create_extended_dataset.py`69- **Text Processing**: Clean markup, remove citations using mwparserfromhell and BeautifulSoup70- **Chunking**: 300 character chunks with 50 character overlap (configurable)71- **Embeddings**: OpenAI text-embedding-3-small (1536 dimensions)72- **Vector Storage**: Qdrant with COSINE distance metric7374### RAG Components75- **Retrieval**: Vector similarity search via Qdrant76- **Reranking**: Cross-encoders using FlagEmbedding and Cohere77- **Generation**: OpenAI GPT models for answer synthesis78- **Evaluation**: RAGAS metrics for comprehensive assessment7980### Evaluation Framework81- **Location**: `naive-rag/rag_evaluator_v2.py`82- **Metrics**: Context recall, precision, relevance using RAGAS83- **Test Data**: `data/wiki_eval_dataset.json` with question-answer pairs8485## Technical Configuration8687### Vector Database Settings88- Collection Name: `workshop_wikipedia_extended`89- Vector Dimension: 153690- Distance Metric: COSINE91- Batch Size: 50 (for API rate limiting)9293### Model Parameters94- Embedding Model: `text-embedding-3-small`95- Chunk Size: 300 characters96- Chunk Overlap: 50 characters97- Temperature: 0.1 (for consistent outputs)9899## Development Guidelines100101### Notebook Structure102- Start with clear objectives and prerequisites103- Include comprehensive imports section104- Add configuration cells for API keys and parameters105- Structure: Setup → Data Loading → Processing → Evaluation106- End with results summary and next steps107108### Error Handling109- Validate environment variables before API calls110- Handle API rate limits gracefully with retry logic111- Provide fallback options for different LLM providers112- Include clear error messages for common setup issues113114### Performance Considerations115- Monitor token usage and costs116- Implement caching for embeddings when possible117- Use batch processing for large datasets118- Optimize chunk sizes based on content type119120## Common Issues & Troubleshooting121122**Collection Not Found**: Run data ingestion script from project root123**Docker Issues**: Check container status with `docker ps`124**API Rate Limits**: Ingestion script includes delay and batch processing125**Environment Variables**: Ensure `.env` file is in project root and restart Jupyter kernel126127## File Structure128129```130├── naive-rag/ # Basic RAG implementation131├── advanced-rag/ # Advanced techniques (reranking, hybrid)132├── scripts/ # Data preparation and ingestion133├── data/ # Processed datasets and evaluation data134├── pyproject.toml # Python dependencies (uv)135├── uv.lock # Locked dependencies136├── SETUP.md # Detailed setup instructions137└── .env # Environment variables (not in git)138```139140When working with this codebase, prioritize educational clarity and maintain the progressive learning structure from naive to advanced RAG techniques.141
Also in Sarangk90/building-rag-app-workshop
Diff this repo’s formatsOne repository carrying more than one format is the comparison this product exists for: does anyone actually write different content in each file, or is one a copy of the other?
| Repository | Format | Stack | Covers | Score | Changed |
|---|---|---|---|---|---|
| Sarangk90/building-rag-app-workshop.clinerules/01-project-context.md · 42 | Cline rules | arch | 43/100 | 3 days ago | |
| Sarangk90/building-rag-app-workshop.clinerules/02-development-guidelines.md · 42 | Cline rules | setupstyleperformance | 48/100 | 3 days ago |
Similar configs
Same format, overlapping stack, ranked by quality.
| Repository | Format | Stack | Covers | Score | Changed |
|---|---|---|---|---|---|
| Adit-Jain-srm/NightmareNetCLAUDE.md · 45 | CLAUDE.md | buildtestlint-formatstyle+6 | 100/100 | 3 days ago | |
| dotCMS/corecore-web/CLAUDE.md · 949 | CLAUDE.md | teststylearchtesting-strategy+3 | 100/100 | 3 days ago | |
| dotCMS/coreCLAUDE.md · 949 | CLAUDE.md | setupbuildteststyle+7 | 99/100 | today | |
| dotCMS/corecore-web/libs/sdk/react/CLAUDE.md · 949 | CLAUDE.md | setupbuildtestlint-format+9 | 97/100 | 3 days ago | |
| modelcontextprotocol/serversCLAUDE.md · 89k | CLAUDE.md | setupbuildtestlint-format+6 | 97/100 | 3 days ago | |
| luongnv89/claude-howtovi/CLAUDE.md · 41k | CLAUDE.md | setupbuildtestlint-format+8 | 97/100 | 3 days ago | |
| dotCMS/corecore-web/libs/sdk/client/CLAUDE.md · 949 | CLAUDE.md | setupbuildtestlint-format+9 | 97/100 | 3 days ago | |
| supabase/supabase.claude/CLAUDE.md · 108k | CLAUDE.md | testlint-formatstylearch+1 | 97/100 | 3 days ago |
