{"id":14764704,"url":"https://github.com/timescale/rag-is-more-than-vector-search","last_synced_at":"2025-05-07T04:58:46.745Z","repository":{"id":256480421,"uuid":"852212389","full_name":"timescale/rag-is-more-than-vector-search","owner":"timescale","description":"Companion repo to \"RAG is more than vector search\" blog post","archived":false,"fork":false,"pushed_at":"2025-03-06T04:06:46.000Z","size":27,"stargazers_count":22,"open_issues_count":2,"forks_count":5,"subscribers_count":12,"default_branch":"main","last_synced_at":"2025-05-07T04:58:42.370Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"https://www.timescale.com/blog/rag-is-more-than-just-vector-search/","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/timescale.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-04T12:25:42.000Z","updated_at":"2025-03-31T19:55:50.000Z","dependencies_parsed_at":"2024-09-14T08:07:15.073Z","dependency_job_id":null,"html_url":"https://github.com/timescale/rag-is-more-than-vector-search","commit_stats":null,"previous_names":["timescale/rag-is-more-than-embeddings","timescale/rag-is-more-than-vector-search"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/timescale%2Frag-is-more-than-vector-search","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/timescale%2Frag-is-more-than-vector-search/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/timescale%2Frag-is-more-than-vector-search/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/timescale%2Frag-is-more-than-vector-search/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/timescale","download_url":"https://codeload.github.com/timescale/rag-is-more-than-vector-search/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252816948,"owners_count":21808704,"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":[],"created_at":"2024-09-16T03:00:36.073Z","updated_at":"2025-05-07T04:58:46.724Z","avatar_url":"https://github.com/timescale.png","language":"Python","funding_links":[],"categories":["Python"],"sub_categories":[],"readme":"# RAG is more than vector search\n\n# Introduction\n\nThis is a repository that contains the code for the article `RAG is more than embeddings`. Head over to the [Timescale blog](https://www.timescale.com/blog/rag-is-more-than-just-vector-search/) to read the article if you haven't already. The code is compatible for python \u003e= 3.9.\n\n## Instructions\n\n1. First install all the required dependencies in the `requirements.txt` file\n\n```\npip install -r requirements.txt\n```\n\n2. Make sure to create a `.env` file that has the same environment variables as our `.env.example ` file. You can get your DB_URL after creating a Timescale instance by following the instructions [here](https://docs.timescale.com/getting-started/latest/services/#create-your-timescale-account).\n\n3. Next, ingest in some Github Issues from the `bigcode/the-stack-github-issues` dataset by running the `scripts/ingest.py` file. This will crawl the first 100 issues that match the list of whitelisted repos in our file. We can do so by running the command below.\n\n```bash\npython3 ./scripts/ingest.py\n```\n\n3. We can then test the function calling ability of our model by running the `scripts/eval.py` file to verify that our model is choosing the right tool with respect to a user query. We can do so by running the command below.\n\n```bash\npython3 ./scripts/eval.py\n```\n\n4. In order to perform embedding search, we can define a new `.execute` function inside our tools themselves. This allows us to call a `.execute()` function when the tool is selected to immediately return a list of relevant results. To see this in action, run the command below and we'll fetch the top 10 relevant summaries from our database related to the `kubernetes/kubernetes` repository using embedding search.\n\n```bash\npython3 ./scripts/embedding_search.py\n```\n\n5. Lastly, we'll put it all together in the `agent.py` file where we'll create a one-step agent that'll be able to answer questions about specific repositories in our database. We can run this agent by executing the command below.\n\n```bash\npython3 ./scripts/agent.py\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftimescale%2Frag-is-more-than-vector-search","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftimescale%2Frag-is-more-than-vector-search","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftimescale%2Frag-is-more-than-vector-search/lists"}