How chandanc5525/rag_using_langchain_langgraph_langsmith works
This repository is a book-code companion with two runtime products: a command-line RAG workbench and the AskMyDocs application. The main user workflow is to upload documents, ingest and index them, then ask questions and receive grounded answers with sources. The workbench also demonstrates advanced retrieval, LangGraph workflows, and evaluation. Relationships below are limited to source excerpts, SOURCE INDEX references, and README statements; unsampled subsystems are represented without speculative internal call chains.
Main entry points: rag_service.py RAG Service · chains.py RAG Chains · main.py CLI Assistant · vectorstore.py Vector Store
Components 29
RAG Workbench
- CLI Assistant
workbench/main.py - Document Ingestion
workbench/rag/ingestion.py - Cleaning
workbench/rag/cleaning.py - Chunking
workbench/rag/chunking.py - Embedding Models
workbench/rag/models.py - Vector Store
workbench/rag/vectorstore.py - Retrieval
workbench/rag/retrieval.py - Context Building
workbench/rag/context.py - RAG Prompts
workbench/rag/prompts.py - Chat Model
workbench/rag/llm.py - RAG Chains
workbench/rag/chains.py
Advanced RAG
- Advanced Retrieval
workbench/rag/advanced.py - LangGraph Workflows
workbench/rag/graphs.py
AskMyDocs Core
- RAG Service
askmydocs/app/services/rag_service.py - File Loaders
askmydocs/app/core/loaders.py - Chunking
askmydocs/app/core/chunking.py - Embedding Factory
askmydocs/app/core/embeddings.py - Document Index
askmydocs/app/core/vectorstore.py - Context Builder
askmydocs/app/core/context.py - Answer Prompts
askmydocs/app/core/prompts.py - Chat Model
askmydocs/app/core/llm.py - Configuration
askmydocs/app/config.py
User Interfaces
- Streamlit Chat
askmydocs/frontend/streamlit_app.py - REST API
askmydocs/backend/main.py - API Schemas
askmydocs/backend/schemas.py
Evaluation
- RAG Evaluation
workbench/rag/evaluation.py
Other components
- CLI User
- Document User
- Ollama Model Service
Connections 29
- CLI User → CLI Assistant: asks
workbench/main.py - CLI Assistant → Vector Store: gets index
workbench/main.py - CLI Assistant → Retrieval: gets retriever
workbench/main.py - CLI Assistant → RAG Chains: builds chain
workbench/main.py - RAG Chains → Retrieval: retrieves
- RAG Chains → Context Building: builds context
workbench/rag/chains.py - RAG Chains → RAG Prompts: uses prompt
workbench/rag/chains.py - RAG Chains → Chat Model: calls model
workbench/rag/chains.py - Vector Store → Document Ingestion: loads documents
workbench/rag/vectorstore.py - Vector Store → Chunking: chunks documents
workbench/rag/vectorstore.py - Vector Store → Embedding Models: uses embeddings
workbench/rag/vectorstore.py - Document Ingestion → Cleaning: enriches text
workbench/rag/ingestion.py - Advanced Retrieval → Retrieval: extends retrieval
- LangGraph Workflows → Retrieval: coordinates retrieval
- RAG Evaluation → Advanced Retrieval: evaluates pipelines
- Document User → Streamlit Chat: chats
README.md - Streamlit Chat → REST API: uses API
README.md - REST API → API Schemas: validates requests
askmydocs/backend/main.py - REST API → RAG Service: delegates
askmydocs/backend/main.py - RAG Service → File Loaders: loads files
askmydocs/app/services/rag_service.py - RAG Service → Chunking: splits documents
askmydocs/app/services/rag_service.py - RAG Service → Embedding Factory: creates embeddings
askmydocs/app/services/rag_service.py - RAG Service → Document Index: searches and updates
askmydocs/app/services/rag_service.py - RAG Service → Context Builder: builds context
askmydocs/app/services/rag_service.py - RAG Service → Answer Prompts: creates chains
askmydocs/app/services/rag_service.py - RAG Service → Chat Model: creates chains
askmydocs/app/services/rag_service.py - RAG Service → Configuration: reads settings
askmydocs/app/services/rag_service.py - RAG Service → Ollama Model Service: checks model
askmydocs/app/services/rag_service.py - Chat Model → Ollama Model Service: connects to
README.md