{"id":15165823,"url":"https://github.com/lzytitan494/simplest-rag","last_synced_at":"2026-02-18T12:31:57.562Z","repository":{"id":250473545,"uuid":"834564795","full_name":"lzytitan494/Simplest-RAG","owner":"lzytitan494","description":"A Retrieval-Augmented Generation (RAG) pipeline for laptop-related issues using Langchain and Chroma DB","archived":false,"fork":false,"pushed_at":"2024-08-06T06:03:37.000Z","size":399,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-07-19T03:31:08.695Z","etag":null,"topics":["chromadb","langchain","llama3","nomic-embed-text","ollama","python","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/lzytitan494.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}},"created_at":"2024-07-27T16:49:37.000Z","updated_at":"2024-08-24T16:32:56.000Z","dependencies_parsed_at":"2024-07-27T18:18:29.615Z","dependency_job_id":"1d0531a9-1e97-4afe-85c0-beab7d072ede","html_url":"https://github.com/lzytitan494/Simplest-RAG","commit_stats":null,"previous_names":["lzytitan494/simple-rag","lzytitan494/simplest-rag"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/lzytitan494/Simplest-RAG","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lzytitan494%2FSimplest-RAG","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lzytitan494%2FSimplest-RAG/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lzytitan494%2FSimplest-RAG/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lzytitan494%2FSimplest-RAG/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/lzytitan494","download_url":"https://codeload.github.com/lzytitan494/Simplest-RAG/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lzytitan494%2FSimplest-RAG/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":279019058,"owners_count":26086512,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-10-14T02:00:06.444Z","response_time":60,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"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":["chromadb","langchain","llama3","nomic-embed-text","ollama","python","rag"],"created_at":"2024-09-27T04:03:25.331Z","updated_at":"2025-10-14T11:09:10.646Z","avatar_url":"https://github.com/lzytitan494.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"## LaptopWiki - RAG Pipeline with Ollama and ChromaDB\n\nThis project implements a Retrieval Augmented Generation (RAG) pipeline for answering questions about laptop issues. It leverages the Laptop Wiki community as a knowledge base and uses powerful open-source language models from Ollama for information extraction and question answering.\n\n\u003cp align=\"center\"\u003e\n\u003cimg src=\"https://github.com/lzytitan494/Simple-RAG/blob/main/RAG.png\" alt=\"RAG Pipeline Diagram\" width=\"600\"/\u003e\n\u003c/p\u003e\n\n### How it Works\n\n1. **Data Extraction and Refinement:**\n    * Data is extracted from the Laptop Wiki community.\n    * The extracted data is rephrased and refined using the `llama3:8b` LLM from Ollama to ensure high-quality language and consistency.\n\n2. **Vector Database Creation:**\n    * The refined data is split into chunks and embedded using the `nomic-embed-text` model from Ollama.\n    * These embeddings are stored in a ChromaDB vector database for efficient similarity search.\n\n3. **Question Answering:**\n    * User queries are embedded using the same `nomic-embed-text` model.\n    * The ChromaDB database is queried for the most relevant chunks based on similarity to the query embedding.\n    * The retrieved chunks, along with the original query, are fed into the `llama3:8b` LLM with a specific prompt to generate a comprehensive and helpful answer.\n\n### Files\n\n* **`create_database.py`:**  This script handles the entire pipeline for creating the vector database:\n    * Downloads the required Ollama models (`llama3:8b`, `nomic-embed-text`).\n    * Loads data from text files in the `sample_data` directory.\n    * Rephrases the loaded data using the `llama3:8b` LLM.\n    * Splits the data into chunks, embeds them, and stores them in the ChromaDB database at the specified path.\n\n* **`query_database.py`:**  This script loads the created database and answers user queries:\n    * Downloads the required Ollama models.\n    * Loads the ChromaDB database from the specified path.\n    * Takes a user query as input, retrieves relevant information from the database, and feeds it to the `llama3:8b` LLM to generate a response. \n\n### Instructions for Running\n\n1. **Install Dependencies:**\n   ```bash\n   pip install -r requirements.txt\n   ```\n   \n2. **Download Ollama Models:**\n   ```bash\n   ollama pull llama3:8b\n   ollama pull nomic-embed-text \n   ```\n\n3. **Prepare your data:**\n   * Place your Laptop Wiki data in text files within the `sample_data` directory. \n\n4. **Create the Database:**\n   ```bash\n   python create_database.py\n   ```\n\n5. **Run the Question Answering System:**\n   ```bash\n   python query_database.py\n   ```\n   You can then input your laptop-related queries.\n\n### Notes:\n\n* Ensure that the paths to your data (`DATA_PATH`) and database (`CHROMA_PATH`) are correctly set in the scripts.\n* ChromaDB persistency can sometimes be finicky. If you encounter issues, try deleting the existing database directory and recreating it.\n* This project is a starting point, and you can further customize it by:\n    * Adding more data sources.\n    * Fine-tuning the LLMs for your specific use case. \n    * Experimenting with different embedding models and prompt engineering for better results. \n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flzytitan494%2Fsimplest-rag","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flzytitan494%2Fsimplest-rag","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flzytitan494%2Fsimplest-rag/lists"}