{"id":45157397,"url":"https://github.com/couchbase-examples/nvidia-rag-demo","last_synced_at":"2026-02-20T05:02:36.009Z","repository":{"id":243203081,"uuid":"811766998","full_name":"couchbase-examples/nvidia-rag-demo","owner":"couchbase-examples","description":null,"archived":false,"fork":false,"pushed_at":"2026-01-13T10:29:10.000Z","size":45,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":4,"default_branch":"main","last_synced_at":"2026-01-13T11:33:12.167Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"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/couchbase-examples.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,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2024-06-07T09:01:47.000Z","updated_at":"2026-01-13T10:29:08.000Z","dependencies_parsed_at":"2026-01-13T11:00:41.997Z","dependency_job_id":null,"html_url":"https://github.com/couchbase-examples/nvidia-rag-demo","commit_stats":null,"previous_names":["couchbase-examples/nvidia-rag-demo"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/couchbase-examples/nvidia-rag-demo","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/couchbase-examples%2Fnvidia-rag-demo","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/couchbase-examples%2Fnvidia-rag-demo/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/couchbase-examples%2Fnvidia-rag-demo/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/couchbase-examples%2Fnvidia-rag-demo/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/couchbase-examples","download_url":"https://codeload.github.com/couchbase-examples/nvidia-rag-demo/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/couchbase-examples%2Fnvidia-rag-demo/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29641929,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-20T03:21:14.183Z","status":"ssl_error","status_checked_at":"2026-02-20T03:18:24.455Z","response_time":59,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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":"2026-02-20T05:02:34.954Z","updated_at":"2026-02-20T05:02:35.997Z","avatar_url":"https://github.com/couchbase-examples.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"## RAG Demo using Couchbase, Nvidia NIM, Meta LLama3, Langchain and Streamlit\n\nThis is a demo app built to chat with your custom PDFs using the vector search capabilities of Couchbase to augment the LLama 3 results in a Retrieval-Augmented-Generation (RAG) model, powered by Nvidia NIM.\n\n### How does it work?\n\nYou can upload your PDFs with custom data \u0026 ask questions about the data in the chat box.\n\nFor each question, you will get two answers:\n\n- one using RAG (Couchbase logo)\n- one using pure LLM - LLama 3 (🤖).\n\nFor RAG, we are using Langchain, Couchbase Vector Search, NVidia NIM \u0026 Meta LLama3. We fetch parts of the PDF relevant to the question using Vector search \u0026 add it as the context to the LLM. The LLM is instructed to answer based on the context from the Vector Store.\n\n### How to Run\n\n- #### Install dependencies\n\n  `pip install -r requirements.txt`\n\n- #### Set the environment secrets\n\n  Copy the `secrets.example.toml` file in `.streamlit` folder and rename it to `secrets.toml` and replace the placeholders with the actual values for your environment\n\n  ```\n  NVIDIA_API_KEY = \"\u003cnvidia_nim_api_key\u003e\"\n  DB_CONN_STR = \"\u003cconnection_string_for_couchbase_cluster\u003e\"\n  DB_USERNAME = \"\u003cusername_for_couchbase_cluster\u003e\"\n  DB_PASSWORD = \"\u003cpassword_for_couchbase_cluster\u003e\"\n  DB_BUCKET = \"\u003cname_of_bucket_to_store_documents\u003e\"\n  DB_SCOPE = \"\u003cname_of_scope_to_store_documents\u003e\"\n  DB_COLLECTION = \"\u003cname_of_collection_to_store_documents\u003e\"\n  INDEX_NAME = \"\u003cname_of_fts_index_with_vector_support\u003e\"\n  LOGIN_PASSWORD = \"\u003cpassword to access the streamlit app\u003e\"\n  ```\n\n- #### Create the Search Index on Full Text Service\n\n  We need to create the Search Index on the Full Text Service in Couchbase. For this demo, you can import the following index using the instructions.\n\n  - [Couchbase Capella](https://docs.couchbase.com/cloud/search/import-search-index.html)\n\n    - Copy the index definition to a new file index.json\n    - Import the file in Capella using the instructions in the documentation.\n    - Click on Create Index to create the index.\n\n  - [Couchbase Server](https://docs.couchbase.com/server/current/search/import-search-index.html)\n\n    - Click on Search -\u003e Add Index -\u003e Import\n    - Copy the following Index definition in the Import screen\n    - Click on Create Index to create the index.\n\n  #### Index Definition\n\n  Here, we are creating the index `pdf_search` on the documents in the `docs` collection within the `shared` scope in the bucket `pdf-docs`. The Vector field is set to `embeddings` with 1024 dimensions and the text field set to `text`. We are also indexing and storing all the fields under `metadata` in the document as a dynamic mapping to account for varying document structures. The similarity metric is set to `dot_product`. If there is a change in these parameters, please adapt the index accordingly.\n\n  ```\n  {\n    \"name\": \"pdf_search\",\n    \"type\": \"fulltext-index\",\n    \"params\": {\n        \"doc_config\": {\n            \"docid_prefix_delim\": \"\",\n            \"docid_regexp\": \"\",\n            \"mode\": \"scope.collection.type_field\",\n            \"type_field\": \"type\"\n        },\n        \"mapping\": {\n            \"default_analyzer\": \"standard\",\n            \"default_datetime_parser\": \"dateTimeOptional\",\n            \"default_field\": \"_all\",\n            \"default_mapping\": {\n                \"dynamic\": true,\n                \"enabled\": false\n            },\n            \"default_type\": \"_default\",\n            \"docvalues_dynamic\": false,\n            \"index_dynamic\": true,\n            \"store_dynamic\": false,\n            \"type_field\": \"_type\",\n            \"types\": {\n                \"shared.docs\": {\n                    \"dynamic\": true,\n                    \"enabled\": true,\n                    \"properties\": {\n                        \"embedding\": {\n                            \"enabled\": true,\n                            \"dynamic\": false,\n                            \"fields\": [\n                                {\n                                    \"dims\": 1024,\n                                    \"index\": true,\n                                    \"name\": \"embedding\",\n                                    \"similarity\": \"dot_product\",\n                                    \"type\": \"vector\",\n                                    \"vector_index_optimized_for\": \"recall\"\n                                }\n                            ]\n                        },\n                        \"text\": {\n                            \"enabled\": true,\n                            \"dynamic\": false,\n                            \"fields\": [\n                                {\n                                    \"index\": true,\n                                    \"name\": \"text\",\n                                    \"store\": true,\n                                    \"type\": \"text\"\n                                }\n                            ]\n                        }\n                    }\n                }\n            }\n        },\n        \"store\": {\n            \"indexType\": \"scorch\",\n            \"segmentVersion\": 16\n        }\n    },\n    \"sourceType\": \"gocbcore\",\n    \"sourceName\": \"pdf-docs\",\n    \"sourceParams\": {},\n    \"planParams\": {\n        \"maxPartitionsPerPIndex\": 64,\n        \"indexPartitions\": 16,\n        \"numReplicas\": 0\n    }\n  }\n  ```\n\n- #### Run the application with streamlit\n\n  `streamlit run chat_with_pdf.py`\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcouchbase-examples%2Fnvidia-rag-demo","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcouchbase-examples%2Fnvidia-rag-demo","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcouchbase-examples%2Fnvidia-rag-demo/lists"}