A small Retrieval-Augmented Generation (RAG) project using LangChain, ChromaDB, and OpenRouter-compatible OpenAI models.
answer_generation.py- Builds a query from a user prompt, searches the persisted Chroma vector store, and generates a response withChatOpenAI.ingetion_pipline.py- Loads.txtdocuments fromdocs/, splits them into chunks, creates embeddings, and persists a ChromaDB vector store.retrival_pipeline.py- Loads the persisted vector store and performs semantic retrieval from the collection.docs/- Contains source text documents used to create embeddings and answer questions.db/chroma_db/- Persisted Chroma vector store directory..env- Environment variables for API keys (not committed).
Run the ingestion pipeline to load documents, split them into chunks, and persist embeddings:
python ingetion_pipline.pyUse the retrieval pipeline to load the persisted Chroma store and perform semantic search:
python retrival_pipeline.pyRun the main answer-generation script:
python answer_generation.pyThis script reads relevant documents from the persisted vector store, combines them into a prompt, and queries the chat model to create an answer.