An AI-powered Retrieval-Augmented Generation (RAG) pipeline designed to ingest complex enterprise documents, convert them into searchable vector embeddings, and accurately answer targeted business queries via REST APIs.
Built to parse high-volume data with 95% context retrieval accuracy and sub-800ms response latency.
🎥 [Insert Link to a GIF or Loom video demonstrating the API or Terminal output here]
- Semantic Vector Search: Implemented advanced document chunking and vector embeddings to retrieve contextually relevant data instantly.
- Zero-Hallucination Prompt Engineering: Strictly constrained the LLM context window and iterated on prompt design to ensure the model only answers using grounded data, heavily mitigating AI hallucinations.
- High-Performance API: Exposed AI capabilities via REST APIs, optimized to seamlessly process over 1,000+ daily JSON payloads.
- Core: Python 3.10
- LLM Orchestration: LangChain / LlamaIndex
- Vector Database: ChromaDB (or FAISS/Pinecone)
- API Framework: FastAPI
- Models: OpenAI GPT-4 API / Open-Source LLMs (e.g., Llama 3)
- Ingestion & Chunking: Enterprise documents (PDFs/TXTs) are ingested and split into semantic chunks with optimized overlap to retain context.
- Embedding: Chunks are vectorized using dense embedding models and stored in a vector database.
- Retrieval & Injection: User queries are vectorized to perform a similarity search. The top-K most relevant chunks are retrieved and injected into a strict system prompt.
- Generation: The LLM is instructed to answer strictly from the injected context, failing gracefully if the answer is not present.
# Clone the repository
git clone [https://github.com/shivkhurana/context-aware-document-agent.git](https://github.com/shivkhurana/context-aware-document-agent.git)
# Navigate into the directory
cd context-aware-document-agent
# Create a virtual environment
python -m venv venv
source venv/bin/activate # On Windows use `venv\Scripts\activate`
# Install dependencies
pip install -r requirements.txt
# Add your API keys to a .env file
echo "OPENAI_API_KEY=your_api_key_here" > .env
# Run the FastAPI server
uvicorn main:app --reload