llama-index-vector-stores-azurecosmosnosql


Namellama-index-vector-stores-azurecosmosnosql JSON
Version 1.3.1 PyPI version JSON
download
home_pageNone
Summaryllama-index vector_stores azurecosmosnosql integration
upload_time2024-12-30 17:24:30
maintainerNone
docs_urlNone
authorAayush Kataria
requires_python<4.0,>=3.9
licenseMIT
keywords
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # Azure Cosmos DB for NoSQL Vector Store

This integration makes possible to use [Azure Cosmos DB for NoSQL](https://learn.microsoft.com/en-us/azure/cosmos-db/nosql/)
as a vector store in LlamaIndex.

## Quick start

Install the integration with:

```sh
pip install llama-index-vector-stores-azurecosmosnosql
```

Create the CosmosDB client:

```python
URI = "AZURE_COSMOSDB_URI"
KEY = "AZURE_COSMOSDB_KEY"
client = CosmosClient(URI, credential=KEY)
```

Specify the vector store properties:

```python
indexing_policy = {
    "indexingMode": "consistent",
    "includedPaths": [{"path": "/*"}],
    "excludedPaths": [{"path": '/"_etag"/?'}],
    "vectorIndexes": [{"path": "/embedding", "type": "quantizedFlat"}],
}

vector_embedding_policy = {
    "vectorEmbeddings": [
        {
            "path": "/embedding",
            "dataType": "float32",
            "distanceFunction": "cosine",
            "dimensions": 3072,
        }
    ]
}
```

Create the vector store:

```python
store = AzureCosmosDBNoSqlVectorSearch(
    cosmos_client=client,
    vector_embedding_policy=vector_embedding_policy,
    indexing_policy=indexing_policy,
    cosmos_container_properties={"partition_key": PartitionKey(path="/id")},
    cosmos_database_properties={},
    create_container=True,
)
```

Finally, create the index from a list containing documents:

```python
storage_context = StorageContext.from_defaults(vector_store=store)

index = VectorStoreIndex.from_documents(
    documents, storage_context=storage_context
)
```

            

Raw data

            {
    "_id": null,
    "home_page": null,
    "name": "llama-index-vector-stores-azurecosmosnosql",
    "maintainer": null,
    "docs_url": null,
    "requires_python": "<4.0,>=3.9",
    "maintainer_email": null,
    "keywords": null,
    "author": "Aayush Kataria",
    "author_email": "aayushkataria3011@gmail.com",
    "download_url": "https://files.pythonhosted.org/packages/7f/58/cfa8f21edc596cf9a7834f092e3eace5b1b9cecf450a96c7f4ddff5d616d/llama_index_vector_stores_azurecosmosnosql-1.3.1.tar.gz",
    "platform": null,
    "description": "# Azure Cosmos DB for NoSQL Vector Store\n\nThis integration makes possible to use [Azure Cosmos DB for NoSQL](https://learn.microsoft.com/en-us/azure/cosmos-db/nosql/)\nas a vector store in LlamaIndex.\n\n## Quick start\n\nInstall the integration with:\n\n```sh\npip install llama-index-vector-stores-azurecosmosnosql\n```\n\nCreate the CosmosDB client:\n\n```python\nURI = \"AZURE_COSMOSDB_URI\"\nKEY = \"AZURE_COSMOSDB_KEY\"\nclient = CosmosClient(URI, credential=KEY)\n```\n\nSpecify the vector store properties:\n\n```python\nindexing_policy = {\n    \"indexingMode\": \"consistent\",\n    \"includedPaths\": [{\"path\": \"/*\"}],\n    \"excludedPaths\": [{\"path\": '/\"_etag\"/?'}],\n    \"vectorIndexes\": [{\"path\": \"/embedding\", \"type\": \"quantizedFlat\"}],\n}\n\nvector_embedding_policy = {\n    \"vectorEmbeddings\": [\n        {\n            \"path\": \"/embedding\",\n            \"dataType\": \"float32\",\n            \"distanceFunction\": \"cosine\",\n            \"dimensions\": 3072,\n        }\n    ]\n}\n```\n\nCreate the vector store:\n\n```python\nstore = AzureCosmosDBNoSqlVectorSearch(\n    cosmos_client=client,\n    vector_embedding_policy=vector_embedding_policy,\n    indexing_policy=indexing_policy,\n    cosmos_container_properties={\"partition_key\": PartitionKey(path=\"/id\")},\n    cosmos_database_properties={},\n    create_container=True,\n)\n```\n\nFinally, create the index from a list containing documents:\n\n```python\nstorage_context = StorageContext.from_defaults(vector_store=store)\n\nindex = VectorStoreIndex.from_documents(\n    documents, storage_context=storage_context\n)\n```\n",
    "bugtrack_url": null,
    "license": "MIT",
    "summary": "llama-index vector_stores azurecosmosnosql integration",
    "version": "1.3.1",
    "project_urls": null,
    "split_keywords": [],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "92787b542149215a452d05210a20bb01aba93dbe6ecd985490b22e055728f514",
                "md5": "b4b4cf805ec6ad34c7896931208b9163",
                "sha256": "8bb682f1196ca48ac85181cba71f7a764e3210a4f32d1be3d6e33d4d4a1d9c15"
            },
            "downloads": -1,
            "filename": "llama_index_vector_stores_azurecosmosnosql-1.3.1-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "b4b4cf805ec6ad34c7896931208b9163",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": "<4.0,>=3.9",
            "size": 5237,
            "upload_time": "2024-12-30T17:24:28",
            "upload_time_iso_8601": "2024-12-30T17:24:28.457836Z",
            "url": "https://files.pythonhosted.org/packages/92/78/7b542149215a452d05210a20bb01aba93dbe6ecd985490b22e055728f514/llama_index_vector_stores_azurecosmosnosql-1.3.1-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "7f58cfa8f21edc596cf9a7834f092e3eace5b1b9cecf450a96c7f4ddff5d616d",
                "md5": "0194d4665f890a261727c9cb96d005ee",
                "sha256": "25519fc245db66ce888dbc4536d51b2cef65b3879d1982ae9f632d8de3753ddb"
            },
            "downloads": -1,
            "filename": "llama_index_vector_stores_azurecosmosnosql-1.3.1.tar.gz",
            "has_sig": false,
            "md5_digest": "0194d4665f890a261727c9cb96d005ee",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": "<4.0,>=3.9",
            "size": 4758,
            "upload_time": "2024-12-30T17:24:30",
            "upload_time_iso_8601": "2024-12-30T17:24:30.500500Z",
            "url": "https://files.pythonhosted.org/packages/7f/58/cfa8f21edc596cf9a7834f092e3eace5b1b9cecf450a96c7f4ddff5d616d/llama_index_vector_stores_azurecosmosnosql-1.3.1.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-12-30 17:24:30",
    "github": false,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "lcname": "llama-index-vector-stores-azurecosmosnosql"
}
        
Elapsed time: 0.44398s