How parithoshd/agrivantage works
The AgriVantage project is a specialized voice bot system designed for the agricultural sector. Its primary goal is to allow farmers to call a dedicated number (managed via Twilio) and receive answers to agriculture-related queries, even in areas with limited internet access. The system leverages FastAPI for its web framework, integrates speech-to-text services (primarily OpenAI Whisper—with Deepgram as an alternative), and uses a Retrieval-Augmented Generation (RAG) chain via LangChain and FAISS to process local documents stored under the "documents" directory.
Main Components
• User’s Phone: The entry point where farmers initiate a call.
• Twilio: Manages incoming voice calls, recording, and triggering webhooks.
• FastAPI Server (main.py): Acts as the central controller to receive HTTP requests from Twilio.
• Speech-to-Text Services: Represents the integration with OpenAI Whisper (and optionally Deepgram) which transcribes the recorded call audio into text.
• RAG Chain Modules: Comprising LangChain and FAISS. This part of the architecture handles query processing using the text transcripts and retrieves relevant information from locally stored documents (found in the "documents" folder).
• Document Processing Component: Responsible for loading and splitting the PDF/text files to build a vector store for the FAISS retrieval system.
• NGROK Tunnel: Dynamically exposes the local FastAPI server to the public internet, easing development and testing.
Relationships and Interactions
• Additionally, add a component for Document Processing that feeds into the LangChain & FAISS module, indicating that local documents (from the "documents" directory) are pre-processed and indexed.
Architectural Patterns and Technologies
• Microservices-like decomposition: voice capture, transcription processing, and document-based answer retrieval.
• Modularity where additional services (like Deepgram) can be optionally integrated into the speech-to-text pipeline.