{"id":20984387,"url":"https://github.com/vits-99/rag-docs-chat","last_synced_at":"2025-03-13T10:44:56.754Z","repository":{"id":240803957,"uuid":"803490910","full_name":"Vits-99/RAG-Docs-Chat","owner":"Vits-99","description":"A modular and extensible framework for building question-answering systems using the LangChain library and FAISS vectorstore.","archived":false,"fork":false,"pushed_at":"2024-05-20T21:45:40.000Z","size":275,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-01-20T07:13:32.201Z","etag":null,"topics":["ai","faiss","faiss-vector-database","langchain","langchain-python","nlp","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":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Vits-99.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","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-05-20T20:31:57.000Z","updated_at":"2024-05-20T21:45:43.000Z","dependencies_parsed_at":null,"dependency_job_id":"ec56b126-f8a4-47d5-8ea5-d0863e58ce79","html_url":"https://github.com/Vits-99/RAG-Docs-Chat","commit_stats":null,"previous_names":["vits-99/rag-docs-chat"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Vits-99%2FRAG-Docs-Chat","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Vits-99%2FRAG-Docs-Chat/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Vits-99%2FRAG-Docs-Chat/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Vits-99%2FRAG-Docs-Chat/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Vits-99","download_url":"https://codeload.github.com/Vits-99/RAG-Docs-Chat/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243392297,"owners_count":20283560,"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","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":["ai","faiss","faiss-vector-database","langchain","langchain-python","nlp","python","rag"],"created_at":"2024-11-19T05:53:23.618Z","updated_at":"2025-03-13T10:44:56.711Z","avatar_url":"https://github.com/Vits-99.png","language":"Python","readme":"# RAG-Docs-Chat\n\n\nRAG-Docs-Chat is a modular and extensible framework for building question-answering systems using the LangChain library. This project demonstrates how to set up a retrieval-augmented generation (RAG) model to process and answer queries based on documents loaded from a PDF file.\n\n\u003cdiv style=\"text-align: center;\"\u003e\n    \u003cimg src=\"./assets/Logo.png\" alt=\"RAG-Docs-Chat Logo\" style=\"max-width: 300px;\"\u003e\n\u003c/div\u003e\n\n## Table of Contents\n\n- [Features](#features)\n- [Installation](#installation)\n- [Usage](#usage)\n- [Project Structure](#project-structure)\n- [Configuration](#configuration)\n\n## Features\n\n- Load and split documents from a PDF file.\n- Embed document chunks using Ollama Embeddings.\n- Retrieve relevant document chunks using FAISS.\n- Generate responses using a ChatOpenAI model.\n- Maintain conversation history with memory buffers.\n- Stream responses in real-time.\n\n## Installation\n\n### Prerequisites\n\n- Python 3.8 or higher\n- `pip` (Python package installer)\n- `virtualenv` (optional but recommended)\n\n### Steps\n\n1. Clone the repository:\n\n    ```bash\n    git clone https://github.com/yourusername/RAG-Docs-Chat.git\n    cd RAG-Docs-Chat\n    ```\n\n2. Create a virtual environment (optional but recommended):\n\n    ```bash\n    python -m venv .venv\n    source .venv/bin/activate   # On Windows, use `.venv\\Scripts\\activate`\n    ```\n\n3. Install the required packages:\n\n    ```bash\n    pip install -r requirements.txt\n    ```\n\n4. Install Ollama:\n\n    Download and install Ollama from the official website: [Download Ollama here!](https://ollama.com/download)\n\n5. Set up the environment variables:\n\n    Create a `.env` file in the root directory of the project and add the following variables:\n\n    ```env\n    MODEL=llama3\n    FILE_PATH=example_file.pdf\n    EMBEDDINGS_MODEL=nomic-embed-text\n    API_KEY=not-needed\n    BASE_URL=http://localhost:11434/v1\n    ```\n\n## Usage\n\nTo start the RAG-Docs-Chat, run the `main.py` script:\n\n```bash\npython main.py\n```\n\nYou will be prompted to enter a message. The assistant will process the message, retrieve relevant context from the documents, and generate a concise response.\n\n## Project Structure\n```env\n.\n├── config.py\n├── example_file.pdf\n├── LICENSE\n├── main.py\n├── models.py\n├── README.md\n├── requirements.txt\n└── utils.py\n```\n\n- config.py: Configuration settings for the project.\n- example_file.pdf: An example PDF file used for loading documents.\n- LICENSE: License information for the project.\n- main.py: The main entry point of the application.\n- models.py: Model-related functions, including initialization of the ChatOpenAI model and RAG chain.\n- README.md: Comprehensive guide and information about the project.\n- requirements.txt: List of dependencies required for the project.\n- utils.py: Utility functions for loading documents, embeddings, memory, and retriever.\n\n## Configuration\nThe project uses environment variables for configuration. These variables are defined in the .env file:\n\n- MODEL: The name of the language model to use.\n- FILE_PATH: The path to the PDF file containing the documents.\n- EMBEDDINGS_MODEL: The embeddings model to use.\n- API_KEY: The API key for the language model.\n- BASE_URL: The base URL for the language model's API.\n\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvits-99%2Frag-docs-chat","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fvits-99%2Frag-docs-chat","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvits-99%2Frag-docs-chat/lists"}