A Retrieval-Augmented Generation (RAG) powered conversational assistant that answers questions based on a custom knowledge base using LangChain and vector storage.
This project demonstrates a complete RAG pipeline that:
rag-assistant/
โโโ src/
โ   โโโ __init__.py
โ   โโโ document_loader.py      # Document ingestion utilities
โ   โโโ vector_store.py         # Vector store management
โ   โโโ rag_chain.py           # Core RAG pipeline
โ   โโโ memory.py              # Conversation memory
โ   โโโ utils.py               # Utility functions
โโโ data/                      # Sample documents and datasets
โโโ examples/                  # Example queries and outputs
โโโ cli.py                     # Command-line interface
โโโ app.py                     # Streamlit web application
โโโ config.py                  # Configuration management
โโโ requirements.txt           # Python dependencies
โโโ README.md                  # This file
Clone the repository:
git clone <your-repo-url> cd rag-assistant
Create a virtual environment:
python -m venv venv source venv/bin/activate # On Windows: venv\Scripts\activate
Install dependencies:
pip install -r requirements.txt
Set up environment variables:
cp .env.example .env # Edit .env with your OpenAI API key
Create a .env file with your configuration:
OPENAI_API_KEY=your_openai_api_key_here VECTOR_STORE_TYPE=faiss # or chroma MODEL_NAME=gpt-3.5-turbo TEMPERATURE=0.7 MAX_TOKENS=1000
from src.document_loader import DocumentLoader from src.vector_store import VectorStore # Load documents loader = DocumentLoader() documents = loader.load_documents("data/") # Create and populate vector store vector_store = VectorStore(store_type="faiss") vector_store.add_documents(documents)
from src.rag_chain import RAGChain # Initialize RAG chain rag = RAGChain(vector_store) # Ask a question response = rag.query("What is this document about?") print(response)
python cli.py --query "Your question here"
streamlit run app.py
Here are some sample questions to test your RAG assistant:
The project includes sample datasets for testing:
This project is submitted for the Agentic AI Developer Certification Program and demonstrates:
Run the certification evaluation script:
python certification_evaluation.py
Run the certification demo:
python examples/certification_demo.py
The assistant is evaluated on:
This is a certification project, but feel free to:
This project is created for educational purposes as part of the Agentic AI Developer Certification Program.
Built with โค๏ธ for the Agentic AI Developer Certification Program