{"id":29031610,"url":"https://github.com/balavenkatesh3322/rag-tutorial","last_synced_at":"2026-04-29T08:34:51.580Z","repository":{"id":301268778,"uuid":"1008709150","full_name":"balavenkatesh3322/rag-tutorial","owner":"balavenkatesh3322","description":"This project implements a modular Retrieval-Augmented Generation (RAG) pipeline using Python OOP concepts and LangChain.","archived":false,"fork":false,"pushed_at":"2025-06-26T01:29:56.000Z","size":6,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-08-18T15:23:45.374Z","etag":null,"topics":["faiss","faiss-vector-database","generative-ai","langchain","llm","openai","rag"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/balavenkatesh3322.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2025-06-26T01:24:46.000Z","updated_at":"2025-06-26T01:29:59.000Z","dependencies_parsed_at":"2025-06-26T02:32:40.642Z","dependency_job_id":"757a4996-10c3-4d02-92b6-8b96b6398ceb","html_url":"https://github.com/balavenkatesh3322/rag-tutorial","commit_stats":null,"previous_names":["balavenkatesh3322/rag-tutorial"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/balavenkatesh3322/rag-tutorial","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/balavenkatesh3322%2Frag-tutorial","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/balavenkatesh3322%2Frag-tutorial/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/balavenkatesh3322%2Frag-tutorial/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/balavenkatesh3322%2Frag-tutorial/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/balavenkatesh3322","download_url":"https://codeload.github.com/balavenkatesh3322/rag-tutorial/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/balavenkatesh3322%2Frag-tutorial/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32418001,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-29T06:29:02.080Z","status":"ssl_error","status_checked_at":"2026-04-29T06:29:00.631Z","response_time":110,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["faiss","faiss-vector-database","generative-ai","langchain","llm","openai","rag"],"created_at":"2025-06-26T10:04:46.494Z","updated_at":"2026-04-29T08:34:51.563Z","avatar_url":"https://github.com/balavenkatesh3322.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# RAG System Tutorial using LangChain\n\nThis project implements a modular Retrieval-Augmented Generation (RAG) pipeline using Python OOP concepts and LangChain. It walks you through setting up a document-based QA system using FAISS for vector storage and OpenAI LLM for answering questions.\n\n## 📁 Project Structure\n\n```\n.\n├── start_rag_here.py       # Main RAG pipeline implementation\n├── sample_data.txt         # Input text file used for ingestion\n└── README.md               # Documentation and usage guide\n```\n\n## 🧠 Components\n\n### 1. **DocumentChunker**\n\nSplits large documents into manageable chunks using LangChain's `RecursiveCharacterTextSplitter`.\n\n### 2. **Embedder**\n\nUses `HuggingFaceEmbeddings` (e.g., `all-MiniLM-L6-v2`) to convert text chunks into dense vectors.\n\n### 3. **VectorDB**\n\nUses FAISS to index embeddings and store them efficiently.\n\n### 4. **Retriever**\n\nFetches relevant document chunks using vector similarity search.\n\n### 5. **RAGPipeline**\n\nCombines a retriever with OpenAI's GPT model to provide answers and source references.\n\n### 6. **RAGSystem**\n\nOrchestrates the end-to-end workflow: loading, chunking, embedding, storing, retrieving, and querying.\n\n---\n\n## ⚙️ Setup Instructions\n\n### 1. Clone the Repository\n\n```bash\n# If stored in Git repo\ngit clone \u003crepo_url\u003e\ncd \u003crepo_name\u003e\n```\n\n### 2. Install Dependencies\n\n```bash\npip install langchain faiss-cpu openai sentence-transformers\n```\n\n### 3. Prepare Environment Variables\n\n```bash\nexport OPENAI_API_KEY=your-openai-api-key\n```\n\nAlternatively, you can use `.env` file and `dotenv` to manage secrets.\n\n### 4. Add Sample Data\n\nPlace your raw document in `sample_data.txt` in the root directory. Example:\n\n```\nLangChain is a framework for developing applications powered by language models.\n```\n\n### 5. Run the Application\n\n```bash\npython start_rag_here.py\n```\n\nYou should see an answer printed along with source documents.\n\n---\n\n## 📌 Notes\n\n- This is a basic RAG setup; you can extend it using LangChain’s advanced retrievers, rerankers, or LangGraph.\n- You can save/load FAISS index using `VectorDB.save_local()` and `load_local()`.\n\n---\n\n## 📈 Future Enhancements\n\n- Add PDF/CSV/URL loaders.\n- Metadata-based filtering.\n- Use LangGraph for stateful RAG workflows.\n- Integrate caching and rate limiters.\n\n---\n\n## 🧠 Credits\n\nBuilt with 💡 using:\n\n- [LangChain](https://github.com/hwchase17/langchain)\n- [FAISS](https://github.com/facebookresearch/faiss)\n- [OpenAI](https://openai.com)\n- [Sentence Transformers](https://www.sbert.net/)\n\n---\n\n## 📬 Feedback\n\nFeel free to reach out or fork the project for improvements!\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbalavenkatesh3322%2Frag-tutorial","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbalavenkatesh3322%2Frag-tutorial","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbalavenkatesh3322%2Frag-tutorial/lists"}