{"id":18571835,"url":"https://github.com/timescale/private-rag-example","last_synced_at":"2025-04-10T20:23:03.006Z","repository":{"id":261468807,"uuid":"869678007","full_name":"timescale/private-rag-example","owner":"timescale","description":"Private RAG app sample using Llama3, Ollama and PostgreSQL","archived":false,"fork":false,"pushed_at":"2024-11-06T17:38:49.000Z","size":344,"stargazers_count":45,"open_issues_count":2,"forks_count":11,"subscribers_count":11,"default_branch":"main","last_synced_at":"2025-03-24T18:03:59.979Z","etag":null,"topics":["llama3","ollama","pgvector","rag"],"latest_commit_sha":null,"homepage":"https://youtu.be/-ikCYKcPoqU","language":"Jupyter Notebook","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-10-08T17:43:09.000Z","updated_at":"2025-03-14T17:50:34.000Z","dependencies_parsed_at":"2024-11-06T18:35:54.214Z","dependency_job_id":"1f885b4d-6d01-40d2-be35-197e5a5560f2","html_url":"https://github.com/timescale/private-rag-example","commit_stats":null,"previous_names":["timescale/private-rag-example"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/timescale%2Fprivate-rag-example","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/timescale%2Fprivate-rag-example/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/timescale%2Fprivate-rag-example/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/timescale%2Fprivate-rag-example/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/timescale","download_url":"https://codeload.github.com/timescale/private-rag-example/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248289994,"owners_count":21078923,"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":["llama3","ollama","pgvector","rag"],"created_at":"2024-11-06T23:03:55.849Z","updated_at":"2025-04-10T20:23:02.974Z","avatar_url":"https://github.com/timescale.png","language":"Jupyter Notebook","funding_links":[],"categories":["Jupyter Notebook"],"sub_categories":[],"readme":"# Local RAG Example\n\n[Watch the video tutorial here](https://youtu.be/-ikCYKcPoqU)\n[Read the blog post using Mistral here](https://www.timescale.com/blog/build-a-fully-local-rag-app-with-postgresql-mistral-and-ollama/)\n\nThis repository contains an example project for building a private Retrieval-Augmented Generation (RAG) application using Llama3.2, Ollama, and PostgreSQL. It demonstrates how to set up a RAG pipeline that does not rely on external API calls, ensuring that sensitive data remains within your infrastructure.\n\n## Prerequisites\n\n * Docker\n * Python, [psycopg](https://www.psycopg.org/)\n * [Ollama](https://github.com/ollama/ollama)\n * [PostgreSQL](https://docs.timescale.com/self-hosted/latest/install/installation-docker/), [pgai](https://github.com/timescale/pgai)\n\n## Docker Setup\n\n* Create a network through which the Ollama and PostgreSQL containers will interact:\n\n  `docker network create local-rag`\n\n* [Ollama](https://hub.docker.com/r/ollama/ollama) docker container: (Note: [`--network`](https://docs.docker.com/engine/network/) tag to make sure that the container runs on the network defined)\n\n  `docker run -d --network local-rag -v ollama:/root/.ollama -p 11434:11434 --name ollama ollama/ollama` \n\n     * [Llama3.2](https://www.llama.com/docs/model-cards-and-prompt-formats/llama3_2): `docker exec -it ollama ollama pull llama3.2`\n     * [Mistral](https://mistral.ai/news/announcing-mistral-7b/?ref=timescale.com): `docker exec -it ollama ollama pull mistral`\n     * [Nomic Embed v1.5](https://www.nomic.ai/blog/posts/nomic-embed-matryoshka?ref=timescale.com): `docker exec -it ollama ollama pull nomic-embed-text`\n\n* [TimescaleDB](https://docs.timescale.com/self-hosted/latest/install/installation-docker/): `docker run -d --network local-rag --name timescaledb -p 5432:5432 -e POSTGRES_PASSWORD=password timescale/timescaledb-ha:pg16`\n\n     * [pgai](https://github.com/timescale/pgai?tab=readme-ov-file#use-a-timescale-cloud-service): `CREATE EXTENSION IF NOT EXISTS \"ai\" VERSION '0.4.0' CASCADE;` (also installs [`pgvector`](https://github.com/pgvector/pgvector) and `plpython3`)\n\n\n \n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftimescale%2Fprivate-rag-example","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftimescale%2Fprivate-rag-example","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftimescale%2Fprivate-rag-example/lists"}