> For the complete documentation index, see [llms.txt](https://dnotifier.gitbook.io/product-docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://dnotifier.gitbook.io/product-docs/ai/vector-stores/python.md). Agents can also search and read this documentation through its [MCP server](https://dnotifier.gitbook.io/product-docs/~gitbook/mcp).

# Python

Set `server_config` on the client, or pass `vector_store` and `embedding` on one knowledge call. CamelCase names (`vectorStore`, `embeddingConfig`, `serverConfig`) are accepted on the call and inside the config dict.

## Client config

```python
import asyncio
from dnotifier import DNotifier

USER_ID = "user-123"

async def main():
    notifier = DNotifier(
        app_id="your-app-id",
        secret="your-app-secret",
        transport="http",
        user_id=USER_ID,
        server_config={
            "vectorStore": {
                "provider": "weaviate",
                "host": "http://127.0.0.1:8080",
                "className": "RagChunk",
            },
            "embedding": {
                "provider": "ollama",
                "baseUrl": "http://127.0.0.1:11434",
                "model": "nomic-embed-text",
            },
        },
    )

    await notifier.connect()

    await notifier.add_document(
        USER_ID,
        record_id="refund-policy",
        content="Refund requests are processed within 5 business days.",
        doc_type="text",
        metadata={"source": "help-center"},
    )

    hits = await notifier.search(
        USER_ID,
        query="how long do refunds take",
        limit=5,
    )
    print(hits)

asyncio.run(main())
```

Assign it later on the same instance. Set it to `None` to return to Postgres and the subscription embedding model.

```python
notifier.server_config = {
    "vector_store": {"provider": "postgres"},
    "embedding": {
        "provider": "open_ai",
        "model": "text-embedding-3-small",
        "dimensions": 1536,
    },
}

notifier.server_config = None
```

## Override one call

The Pinecone store is used for this search. The embedding you already set is still used.

```python
await notifier.search(
    USER_ID,
    query="refund timeline",
    vector_store={
        "provider": "pinecone",
        "apiKey": pinecone_api_key,
        "host": pinecone_host,
        "namespace": "help-center",
    },
)
```

`vector_store_config` and `embedding_config` are the same options. A `server_config` argument applies to that call only:

```python
await notifier.delete_document(
    USER_ID,
    record_id="refund-policy",
    server_config={
        "vectorStore": {"provider": "qdrant", "host": "https://qdrant.example"},
        "embeddingConfig": {"provider": "gemini", "apiKey": gemini_api_key},
    },
)
```

The same keyword arguments work on `update_document`, `get_document`, and `list_documents`.

## Workflow context

`ctx.search` and the document helpers take `vector_store`, `embedding`, and `label`. `ctx.notifier.server_config` is used when the call leaves them out.

```python
hits = await ctx.search(
    query="refund policy",
    limit=5,
    label="FAQ search",
    vector_store={"provider": "postgres"},
)
```

## Learn more

* [**Vector stores and embeddings**](https://dnotifier.gitbook.io/product-docs/ai/vector-stores.md) — providers, required fields, and defaults
* [**Semantic search**](https://dnotifier.gitbook.io/product-docs/ai/semantic-search/python.md)
* [**Manage documents**](https://dnotifier.gitbook.io/product-docs/ai/manage-documents/python.md)
