{"id":45157386,"url":"https://github.com/couchbase-examples/vector-search-cookbook","last_synced_at":"2026-02-20T05:02:32.637Z","repository":{"id":252365458,"uuid":"838715539","full_name":"couchbase-examples/vector-search-cookbook","owner":"couchbase-examples","description":"Cookbook containing recipes for using Couchbase Vector Search using different Embedding \u0026 Large Language Models","archived":false,"fork":false,"pushed_at":"2026-02-19T06:21:34.000Z","size":21545,"stargazers_count":9,"open_issues_count":6,"forks_count":10,"subscribers_count":6,"default_branch":"main","last_synced_at":"2026-02-19T11:41:15.329Z","etag":null,"topics":["agents","hacktoberfest","rag","vector-search"],"latest_commit_sha":null,"homepage":"https://developer.couchbase.com/tutorials/","language":"Jupyter Notebook","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-08-06T07:46:44.000Z","updated_at":"2026-02-19T06:21:39.000Z","dependencies_parsed_at":"2024-11-27T11:21:42.531Z","dependency_job_id":"4273a4ef-8006-4726-9559-71f2e47ba38f","html_url":"https://github.com/couchbase-examples/vector-search-cookbook","commit_stats":null,"previous_names":["couchbase-examples/vector-search-cookbook"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/couchbase-examples/vector-search-cookbook","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/couchbase-examples%2Fvector-search-cookbook","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/couchbase-examples%2Fvector-search-cookbook/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/couchbase-examples%2Fvector-search-cookbook/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/couchbase-examples%2Fvector-search-cookbook/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/couchbase-examples","download_url":"https://codeload.github.com/couchbase-examples/vector-search-cookbook/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/couchbase-examples%2Fvector-search-cookbook/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":["agents","hacktoberfest","rag","vector-search"],"created_at":"2026-02-20T05:02:31.939Z","updated_at":"2026-02-20T05:02:32.633Z","avatar_url":"https://github.com/couchbase-examples.png","language":"Jupyter Notebook","funding_links":[],"categories":[],"sub_categories":[],"readme":"## Semantic Search with Couchbase Vector Store and LLM Integration\n\nThis repository demonstrates how to build a powerful semantic search engine using Couchbase as the backend database, combined with various AI-powered embedding and language model providers such as OpenAI, Azure OpenAI, Anthropic (Claude), Cohere, Hugging Face, Jina AI, Mistral AI, and Voyage AI.\n\nEach example provides two distinct approaches:\n- **Search Vector Index**: Uses Couchbase's vector search capabilities with pre-created search indices\n- **Hyperscale Vector Index, Composite Vector Index**: Leverages Couchbase's native SQL++ queries with vector similarity functions\n\nSemantic search goes beyond simple keyword matching by understanding the context and meaning behind the words in a query, making it essential for applications that require intelligent information retrieval.\n\n### Features\n\n- **Multiple Embedding Models**: Support for embeddings from OpenAI, Azure OpenAI, Anthropic (Claude), Cohere, Hugging Face, Jina AI, Mistral AI, and Voyage AI.\n- **Couchbase Vector Store**: Utilizes Couchbase's vector storage capabilities for efficient similarity search.\n- **Retrieval-Augmented Generation (RAG)**: Integrates with advanced language models like GPT-4 for generating contextually relevant responses.\n- **Scalable and Flexible**: Easy to switch between different embedding models and adjust the index structure accordingly.\n- **Caching Mechanism**: Implements `CouchbaseCache` for improved performance on repeated queries.\n\n### Prerequisites\n\n- Python 3.8+\n- Couchbase Cluster (Self Managed or Capella) version 7.6+ with [Search Service](https://docs.couchbase.com/server/current/search/search.html)\n\n- API keys for the respective AI providers (e.g., OpenAI, Azure OpenAI, Anthropic, Cohere, etc.)\n\n### Setup\n\n#### 1. Clone the repository:\n   ```bash\n   git clone https://github.com/your-username/vector-search-cookbook.git\n   cd vector-search-cookbook\n   ```\n\n#### 2. Choose Your Approach:\n\n##### For Search Vector Index Examples:\nUse the provided `{model}_index.json` index definition file in each model's `search_based/` directory to create a new vector search index in your Couchbase cluster.\n\n##### For Hyperscale Vector Index, Composite Vector Index Examples:\nNo additional setup required. Hyperscale and Composite Vector Indexes will be created in each model's example.\n\n#### 3. Run the notebook file\n\nYou can either run the notebook file on [Google Colab](https://colab.research.google.com/) or run it on your system by setting up the Python environment.\n\n\n### Components\n\n#### 1. Multiple Embedding Models\n\nThe system supports embeddings from various AI providers:\n\n* OpenAI\n* Azure OpenAI\n* Anthropic (Claude)\n* Cohere\n* Hugging Face\n* Jina AI\n* Mistral AI\n* Voyage AI\n\n#### 2. Couchbase Vector Store\n\nCouchbase is used to store document embeddings and metadata. The index structure allows for efficient retrieval across different embedding types.\n\n#### 3. Retrieval-Augmented Generation (RAG)\n\nThe RAG pipeline integrates with language models like GPT-4 to generate contextually relevant answers based on retrieved documents.\n\n#### 4. Semantic Search\n\nEach notebook implements a semantic search function that performs similarity searche using the appropriate embedding type and retrieves the top-k most similar documents.\n\n#### 5. Caching\n\nThe system implements caching functionality using `CouchbaseCache` to improve performance for repeated queries.\n\n### Couchbase Search Vector Index\n\nFor Search Vector Index examples, you'll need to create a vector search index using the provided JSON configuration files. For more information on creating a vector search index, please follow the [instructions](https://docs.couchbase.com/cloud/vector-search/create-vector-search-index-ui.html). The following is an example for Azure OpenAI Model.\n\n```json\n{\n    \"type\": \"fulltext-index\",\n    \"name\": \"vector_search_azure\",\n    \"uuid\": \"\",\n    \"sourceType\": \"gocbcore\",\n    \"sourceName\": \"vector-search-testing\",\n    \"planParams\": {\n      \"maxPartitionsPerPIndex\": 64,\n      \"indexPartitions\": 16\n    },\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        \"analysis\": {},\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.azure\": {\n            \"dynamic\": true,\n            \"enabled\": true,\n            \"properties\": {\n              \"embedding\": {\n                \"dynamic\": false,\n                \"enabled\": true,\n                \"fields\": [\n                  {\n                    \"dims\": 1536,\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                \"dynamic\": false,\n                \"enabled\": true,\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    \"sourceParams\": {}\n  }\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcouchbase-examples%2Fvector-search-cookbook","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcouchbase-examples%2Fvector-search-cookbook","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcouchbase-examples%2Fvector-search-cookbook/lists"}