How thomasjanssen-tech/chatbot-with-rag-and-langchain works
Project type and purpose
• This is a small Python-based full-stack “chatbot” tool that implements Retrieval-Augmented Generation (RAG) using LangChain.
• ingest_database.py builds the vector‐store (by reading PDFs from data/), and chatbot.py serves as the user-facing interactive chatbot that retrieves context and calls the OpenAI API.
File structure
• Top-level scripts:
– ingest_database.py: loads documents, splits them into chunks, creates embeddings, and writes them into a vector database.
– chatbot.py: reads user input, queries the vector database for relevant chunks, and orchestrates calls to the LLM via LangChain.
• data/: stores source documents (e.g., the “Attention Is All You Need” paper).
• .env (from .env.example): holds the OpenAI API key.
• requirements.txt: lists dependencies (langchain, openai, vector-store adapter such as Chroma or Pinecone, etc.).
README for additional insights
• Implies usage of OpenAI API, LangChain as the orchestrator, and a local or hosted vector store.