How lorenzejay/agentic-rag-practical-example works
What this project is (type + purpose)
This is a Python “agentic RAG” orchestration project built on crewAI. It defines a hierarchical multi-agent system where a Manager agent routes a user query into one or more tasks, delegating to specialized agents that use specialized tools:
• WeaviateTool: RAG over internal documents (vector DB retrieval)
• ExaSearchTool: RAG over web/external search
• Groq (and/or OpenAI per .env note): LLM inference for reasoning/summarization
It looks like a template/reference implementation that loads documents, runs a crew process, and produces outputs like report.md and artifacts in outputs/.
So the “system” is less a web service and more a CLI-run orchestration pipeline with external dependencies (LLM providers + Weaviate + web search).
Key directories/files and what they represent:
• src/agentic_rag/main.py
Entry point (invoked via crewai run). Owns CLI/runtime inputs and kicks off execution.
• src/agentic_rag/crew.py
Orchestration assembly: constructs the Crew, registers agents, attaches tools, sets hierarchical manager process.
• src/agentic_rag/config/agents.yaml
Declarative agent definitions: roles, goals, model settings, tool access, etc.
• src/agentic_rag/config/tasks.yaml
Declarative task graph: task descriptions, expected outputs, ordering/dependencies.
• src/agentic_rag/tools/weaviate_tool.py
Integration boundary to Weaviate (vector DB retrieval). This is a major component.
• src/agentic_rag/tools/custom_tool.py
Custom tools / extension point. (Also indicates where ExaSearch might be implemented if not separately present in tree.)
• src/agentic_rag/load_docs.py
Ingestion/indexing pipeline (likely reads from internal_docs/ and pushes embeddings/docs into Weaviate).
• docker-compose.yml
• internal_docs/*.md
Data source for internal knowledge.
• report.md, outputs/*
Output artifacts (end of the workflow).
• pyproject.toml, uv.lock
What the README adds (behavior + interactions)
The README confirms:
• Hierarchical manager-agent pattern (manager assigns tasks)
• Specialized RAG tools:
• Weaviate (internal)
• Exa (web)
• Groq for fast inference (plus mention of OPENAI_API_KEY, so LLM provider is an external service boundary)
• Output: generates a report.md
Level 0 (Context)
Actors / external systems:
• User / Operator (runs crewai run, provides prompt/query)
• LLM Provider (Groq + possibly OpenAI)
• Weaviate (vector database)
• Web Search Provider (ExaSearch)
• (Optional) Local filesystem (internal_docs input, outputs/report output)
Level 1 (Containers)
• AgenticRag CLI Application (Python)
• Runs crewAI process
• Reads YAML configs
• Calls tools
• Writes outputs
• Weaviate (Docker container)
• Stores vectors/documents
• Serves semantic search
• LLM Inference Service (Groq/OpenAI)
• Used by agents for reasoning and generation
• Exa Search API
• Used for web retrieval
• Filesystem
• internal_docs/ as knowledge source
• report.md and outputs/ as sinks
Level 2 (Components inside the Python app)
• main.py → Runtime/CLI entry
• crew.py → Crew builder / Manager-agent orchestration
• config/agents.yaml → Agent registry/config
• config/tasks.yaml → Task definitions / workflow
• tools/weaviate_tool.py → Weaviate retrieval tool
• tools/custom_tool.py → Custom/extension tools (possibly Exa wrapper)
• load_docs.py → Document ingestion/indexing
load_docs.py → Weaviate: upsert documents + vectors
Even if the README doesn’t detail ingestion, the presence of load_docs.py + internal_docs/ + Weaviate strongly suggests it; include it as a separate flow.
• crewAI (orchestration framework)
• Python 3.10–3.13
• Weaviate (vector DB) + “docker-compose” runtime
• Groq and/or OpenAI (LLM inference)
• ExaSearch (web retrieval)
• Markdown docs as source format
Required elements
• Clear labels: use exact names where possible (crew.py, weaviate_tool.py, agents.yaml)
• “loads config”, “delegates task”, “retrieves passages”, “calls LLM”, “writes report”
• Another for external services/APIs
• Another for data stores (Weaviate, filesystem)
• Another for artifacts (reports)