{"id":15054957,"url":"https://github.com/tlecomte13/example-rag-csv-ollama","last_synced_at":"2026-04-01T22:07:13.447Z","repository":{"id":255678814,"uuid":"853386266","full_name":"Tlecomte13/example-rag-csv-ollama","owner":"Tlecomte13","description":"This project uses LangChain to load CSV documents, split them into chunks, store them in a Chroma database, and query this database using a language model. It allows adding documents to the database, resetting the database, and generating context-based responses from the stored documents.","archived":false,"fork":false,"pushed_at":"2024-09-06T15:00:04.000Z","size":3,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-01-20T23:26:11.475Z","etag":null,"topics":["chroma","chromadb","csv","langchain","langchain-python","ollama","python"],"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/Tlecomte13.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-09-06T14:52:48.000Z","updated_at":"2024-09-06T15:00:07.000Z","dependencies_parsed_at":null,"dependency_job_id":"4046a7b9-1226-4bd2-b319-6d6c273f3403","html_url":"https://github.com/Tlecomte13/example-rag-csv-ollama","commit_stats":null,"previous_names":["tlecomte13/example-rag-csv-ollama"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Tlecomte13%2Fexample-rag-csv-ollama","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Tlecomte13%2Fexample-rag-csv-ollama/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Tlecomte13%2Fexample-rag-csv-ollama/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Tlecomte13%2Fexample-rag-csv-ollama/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Tlecomte13","download_url":"https://codeload.github.com/Tlecomte13/example-rag-csv-ollama/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243523182,"owners_count":20304549,"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":["chroma","chromadb","csv","langchain","langchain-python","ollama","python"],"created_at":"2024-09-24T21:39:15.692Z","updated_at":"2025-12-27T23:25:32.546Z","avatar_url":"https://github.com/Tlecomte13.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Example Project: create RAG (Retrieval-Augmented Generation) with LangChain and Ollama\n\nThis project uses LangChain to load CSV documents, split them into chunks, store them in a Chroma database, and query this database using a language model.\n\n## Prerequisites\n\n- [Ollama](https://ollama.com/download)\n- Python 3.8 or higher\n- pip\n\n## Installation\n\n1. Clone the repository:\n    ```bash\n    git clone \u003cREPOSITORY_URL\u003e\n    cd \u003cREPOSITORY_NAME\u003e\n    ```\n   \n2. Create a virtual environment:\n    ```bash\n    python -m venv venv\n    source venv/bin/activate\n    ```\n\n3. Install the dependencies:\n    ```bash\n    pip install -r requirements.txt\n    ```\n   \n4. Install model with Ollama:\n    ```bash\n    ollama pull \u003cYOUR_MODEL\u003e \n    ```\n\n## Configuration\n\nEnsure that the `config.yaml` file is correctly configured.\n\n## Usage\nAdd documents to the database\nTo add documents to the Chroma database, run:\n\n```bash\npython add_csv_in_database.py\n```\n\nYou can reset the database using the --reset option:\n\n```bash\npython add_csv_in_database.py --reset\n```\n\nQuery the database\n\nTo query the database, run:\n\n```bash\npython main.py\n```\n\n## Project Structure\n* **add_csv_in_database.py**: Script to load CSV documents, split them into chunks, and add them to the Chroma database.\n* **main.py**: Script to query the Chroma database and generate context-based responses.\n* **helper/get_embedding_function.py**: Utility function to get the embedding function.\n* **config.yaml**: Configuration file for file paths, models, and text splitting parameters.\n\n## Dependencies\n\n* langchain_community\n* langchain_chroma\n* tqdm\n* rich\n* pyyaml\n\n### Sources\n\nhttps://www.sakunaharinda.xyz/ragatouille-book/intro.html  \nhttps://ollama.com/  \nhttps://www.youtube.com/watch?v=2TJxpyO3ei4  \nhttps://python.langchain.com/v0.2/docs/introduction/\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftlecomte13%2Fexample-rag-csv-ollama","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftlecomte13%2Fexample-rag-csv-ollama","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftlecomte13%2Fexample-rag-csv-ollama/lists"}