RAG system for documentation search using Weaviate. Crawls documentation websites, chunks content, stores in a vector database, and provides semantic search through an MCP server.
- Python 3.10+
- Docker & Docker Compose
- API Keys:
COHERE_API_KEY,ANTHROPIC_API_KEY(set as environment variables)
# Start Weaviate
docker-compose up -d
# Install dependencies
uv syncpython 1_get_docs.pyCrawls docs.weaviate.io and saves to ./output/weaviate_docs_crawl4ai.json
python 2_index_docs.pyChunks documents and indexes them in Weaviate with Cohere embeddings
python 3_check_rag.pyExample query using Weaviate's generative module with Claude
python 4_build_mcp.pyStarts the MCP server that exposes search_weaviate_docs tool
python 5_agent_example.pyDemonstrates using the MCP server with pydantic-ai to answer Weaviate questions
Pipeline: Crawl ’ Chunk ’ Index ’ Retrieve
- Crawler: crawl4ai (BFS, depth 4)
- Chunker: chonkie TokenChunker (512 tokens, 128 overlap)
- Vector DB: Weaviate with Cohere embed-v4.0
- MCP Server: Returns raw chunks for agent-side generation
- Agent: pydantic-ai with Claude 3.5 Haiku
Edit these files to customize:
1_get_docs.py:8- Change crawl domain2_index_docs.py:17-20- Adjust chunk size/overlap4_build_mcp.py- Modify MCP tool behavior5_agent_example.py:20-35- Customize agent system prompt
# Reset database
python 0_reset_db.py