How santhoshm007/fde_rag works
WeedRAG is a chat application for weed identification and management, grounded in an ingested PDF knowledge base. Users create or select a chat, submit a question, and receive an answer displayed in the conversation; chat history is stored in browser local storage. The server retrieves relevant Chroma content, augments it with a domain-specific prompt, and invokes a language model. A separate ingestion workflow loads PDFs, chunks them, embeds them, and persists them to Chroma. The available source shows the main UI composition and server calls; some component behavior and the augment implementation are not sampled.
Main entry points: app.py RAG workflow · useChat.js Chat state · ingest.py PDF ingestion · App.jsx App shell
Components 22
Chat client
- App shell
client/src/App.jsx - Chat state
client/src/hooks/useChat.js - Chat sidebar
client/src/components/Sidebar.jsx - Chat area
client/src/components/ChatArea.jsx - Chat header
client/src/components/ChatHeader.jsx - Message list
client/src/components/MessageList.jsx - Message bubble
client/src/components/MessageBubble.jsx - Thinking indicator
client/src/components/ThinkingDots.jsx - Empty state
client/src/components/EmptyState.jsx - Message input
client/src/components/InputBar.jsx
Chat service
- Chat API
server/app/app.py - RAG workflow
server/app/app.py - Similarity retrieval
server/app/retrieval.py - Prompt augmentation
server/app/augment.py - Domain prompt
server/app/prompt.py - Model configuration
server/app/config.py
Knowledge base
- PDF ingestion
server/app/ingest.py - Weed guide PDF
server/data/NoxWeedMangementGuide2019LasAnimas.pdf - Chroma vector store
server/db/chroma
External services
- Browser storage
- OpenAI models
Other components
- User
Connections 26
- User → App shell: uses
- App shell → Chat state: reads state
client/src/App.jsx - App shell → Chat sidebar: renders
client/src/App.jsx - App shell → Chat area: renders
client/src/App.jsx - Chat state → Browser storage: persists chats
client/src/hooks/useChat.js - Chat state → Chat API: sends question
client/src/hooks/useChat.js - Chat sidebar → Chat state: triggers chat actions
client/src/App.jsx - Chat area → Chat header: renders
client/src/components/ChatArea.jsx - Chat area → Message list: renders
client/src/components/ChatArea.jsx - Chat area → Message input: renders
client/src/components/ChatArea.jsx - Message input → Chat state: submits message
- Message list → Message bubble: renders
client/src/components/MessageList.jsx - Message list → Thinking indicator: shows while loading
client/src/components/MessageList.jsx - Message list → Empty state: shows when empty
client/src/components/MessageList.jsx - Chat API → RAG workflow: invokes
server/app/app.py - RAG workflow → Similarity retrieval: retrieves context
server/app/app.py - RAG workflow → Prompt augmentation: builds prompt
server/app/app.py - RAG workflow → OpenAI models: invokes chat model
server/app/app.py - Similarity retrieval → Chroma vector store: searches
server/app/retrieval.py - Prompt augmentation → Domain prompt: uses prompt template
server/app/augment.py - Model configuration → Domain prompt: imports template
server/app/config.py - PDF ingestion → Weed guide PDF: loads documents
server/app/ingest.py - PDF ingestion → Model configuration: reads settings
server/app/ingest.py - PDF ingestion → OpenAI models: creates embeddings
server/app/ingest.py - PDF ingestion → Chroma vector store: persists vectors
server/app/ingest.py - RAG workflow → Chroma vector store: opens store
server/app/app.py