{"id":28471713,"url":"https://github.com/bitcrowd/rag_time","last_synced_at":"2025-07-01T22:30:52.277Z","repository":{"id":243677994,"uuid":"811253521","full_name":"bitcrowd/rag_time","owner":"bitcrowd","description":"💁 Example code for a blog post series about using a RAG system on a local codebase.","archived":false,"fork":false,"pushed_at":"2024-11-11T17:27:05.000Z","size":32,"stargazers_count":28,"open_issues_count":2,"forks_count":5,"subscribers_count":6,"default_branch":"main","last_synced_at":"2025-06-30T12:52:04.833Z","etag":null,"topics":["ai","information-retrieval","infoserver","llm","rag"],"latest_commit_sha":null,"homepage":"https://bitcrowd.dev/tags/rag","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/bitcrowd.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-06-06T08:36:19.000Z","updated_at":"2025-05-27T02:06:42.000Z","dependencies_parsed_at":"2024-06-22T00:42:09.089Z","dependency_job_id":null,"html_url":"https://github.com/bitcrowd/rag_time","commit_stats":null,"previous_names":["bitcrowd/rag_time"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/bitcrowd/rag_time","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bitcrowd%2Frag_time","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bitcrowd%2Frag_time/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bitcrowd%2Frag_time/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bitcrowd%2Frag_time/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/bitcrowd","download_url":"https://codeload.github.com/bitcrowd/rag_time/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bitcrowd%2Frag_time/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":263046060,"owners_count":23405126,"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","information-retrieval","infoserver","llm","rag"],"created_at":"2025-06-07T11:08:36.166Z","updated_at":"2025-07-01T22:30:52.258Z","avatar_url":"https://github.com/bitcrowd.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# rag_time\n\nSimple Chat UI to chat about a private codebase using LLMs locally.\n\n**Technology:**\n\n- [Ollama](https://ollama.ai/) and [llama3:8b](https://ollama.com/library/llama3:8b) as Large Language Model\n- [jina-embeddings-v2-base-code](https://jina.ai/news/elevate-your-code-search-with-new-jina-code-embeddings) as Embedding Model\n- [LangChain](https://python.langchain.com/en/latest/modules/models/llms/integrations/huggingface_hub.html) as a framework for LLM\n- [Chainlit](https://docs.chainlit.io/) for the chat UI\n\n## Getting started\n\n### Prerequisites\n\n1. Make sure you have Python 3.9 or later installed\n2. Download and install [Ollama](https://ollama.com/download)\n3. Pull the model:\n\n   ```bash\n   ollama pull llama3:8b\n   ```\n\n4. Run the model:\n\n   ```bash\n   ollama run llama3:8b\n   ```\n\n### Run the Chat bot\n\n1. Create a Python virtual environment and activate it:\n\n   ```bash\n   python3 -m venv .venv-rag-time \u0026\u0026 source .venv-rag-time/bin/activate\n   ```\n\n2. Install Python dependencies:\n\n   ```bash\n   pip install -r requirements.txt\n   ```\n\n3. Clone an example repository to question the chat bot about:\n\n   ```bash\n   git clone https://github.com/discourse/discourse\n   ```\n\n4. Set up the vector database:\n\n   ```bash\n   python ingest-code.py\n   ```\n\n5. Start the chat bot:\n\n   ```bash\n   chainlit run main.py\n   ```\n\n6. To exit the Python virtual environment after you are done, run:\n\n   ```bash\n   deactivate\n   ```\n\n## Make it your own\n\nModify the `.env` file to run the chat bot on your codebase and language.\n\n### Ask Questions\n\n\"The file \"....ex\" is missing a module comment. Can you create one that helps new team members understand what it does, and how it works?\"\n\n\"Given the following Mission, can you please explain what files I should change, and how I can implement the changes?\"\n\n## Enhancements\n\n### Use the advanced script to process the codebase\n\nThe script `ingest-code.py` is intended to be easy to understand and to modify. For more control over the codebase processing, you can use the `process_codebase.py` script. \n\n```bash\nusage: process_codebase.py [-h] [-c] [-cd CHUNKS_DIR] [-db CHROMA_DB_DIR] [-oh] [-ed] base_directory\n\nProcess subdirectories for chunking and ingestion.\n\npositional arguments:\n  base_directory        Base directory to process\n\noptions:\n  -h, --help            show this help message and exit\n  -c, --clean           Clean existing chunks and chroma db before processing\n  -cd CHUNKS_DIR, --chunks_dir CHUNKS_DIR\n                        If given, chunks are stored into this directory.\n  -db CHROMA_DB_DIR, --chroma_db_dir CHROMA_DB_DIR\n                        Directory for Chroma DB (default: .rag_time/chroma_db)\n  -oh, --omit-headers   Do not add filename header in chunks\n  -ed, --empty_db       Only create an empty chroma db\n\n```\n\nTo do achieve the same result as `ingest-code.py`, you can run:\n\n```bash\npython process_codebase.py -c -db .rag_time/chroma_db ./discourse\n```\n\nTo use this in chainlit, you can set the `CODEBASE_PATH` environment variable to the directory you want to process:\n\n```bash\nexport VECTOR_DB_PATH=\".rag_time/chroma_db\" ; chainlit run main.py\n```\n\nThe switches `-c`, `-ed` and `-oh` are useful to evaluate the impact of different processing options.","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbitcrowd%2Frag_time","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbitcrowd%2Frag_time","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbitcrowd%2Frag_time/lists"}