π Publication: Foundations of Agentic AI β My First RAG Assistant
Abstract
This project demonstrates the development of a simple Retrieval-Augmented Generation (RAG) Assistant using Streamlit, LangChain, OpenAI GPT models, and FAISS for vector search. The assistant enables users to upload documents (PDF, TXT, DOCX) and ask natural language questions. The system retrieves relevant document sections and generates context-aware answers with cited sources. This work forms the foundation of building agentic AI systems, aligning with the goals of the AAIDC Module 1 curriculum.
Introduction
Large Language Models (LLMs) are powerful for question answering but often hallucinate without access to external knowledge. Retrieval-Augmented Generation (RAG) addresses this by combining LLMs with a knowledge base created from user documents.
This project introduces learners to:
Document ingestion (PDF, TXT, DOCX)
Embedding creation with OpenAI models
Vector storage using FAISS
A query pipeline that retrieves document chunks and generates answers
Memory and logging for extended usability
Methodology
The RAG Assistant was implemented in Python with a modular architecture:
loader.py β Loads and parses documents into text chunks.
vector_store.py β Builds a FAISS vector database using OpenAI embeddings.
rag_chain.pyβDefines a RetrievalQA chain with GPT-3.5 as the reasoning engine.
memory.py β Adds conversation memory for multi-turn dialogue.
logger.py β Stores user queries, responses, and sources for future review.
app.pyβStreamlit UI allowing file upload, querying, and displaying results.
Dependencies were managed via a requirements.txt file, including Streamlit, LangChain, OpenAI, FAISS, and document loaders.
Results
Users can upload documents into the assistant.
Queries are processed, and relevant sections are retrieved.
The assistant provides answers with citations from the uploaded content.
A log file is generated for every query-response interaction.
The system runs locally via Streamlit at http://localhost:8501.
This demonstrates the practical power of RAG in enabling document-aware conversational assistants.
Challenges & Learnings
Environment setup: Installing Streamlit and LangChain correctly was crucial.
API key management: The OpenAI key needed to be securely stored via environment variables.
Document parsing: Handling multiple file types required loaders.
Blank UI issues
by ensuring all helper .py files were implemented.Through this, I gained strong exposure to LangChain modular design and LLM integration.
Conclusion
This project successfully delivers a working RAG Assistant prototype. It provides a baseline for building agentic AI systems that can ground responses in trusted knowledge sources. The design is modular and extendable for more advanced workflows.
Future Work
Add multi-document memory for persistent knowledge.
Integrate web search tools alongside document retrieval.
Deploy the assistant to the cloud (Streamlit Cloud / Hugging Face).
Extend to Module 2 projects focusing on tools and autonomous agents.