> 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/dart-flutter.md). Agents can also search and read this documentation through its [MCP server](https://dnotifier.gitbook.io/product-docs/~gitbook/mcp).

# Dart / Flutter

Set `serverConfig` on the client, or pass `vectorStore` and `embedding` on one knowledge call.

## Client config

```dart
import 'package:dnotifier/dnotifier.dart';

const userId = 'user-123';

Future<void> main() async {
  final notifier = DNotifier(
    appId: 'your-app-id',
    secret: 'your-app-secret',
    transport: 'http',
    userId: userId,
    serverConfig: {
      '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',
      },
    },
    onConnected: () {},
    onMessage: (_) {},
  );

  await notifier.connect();

  await notifier.addDocument(
    senderId: userId,
    recordId: 'refund-policy',
    content: 'Refund requests are processed within 5 business days.',
    type: 'text',
    metadata: {'source': 'help-center'},
  );

  final hits = await notifier.search(
    senderId: userId,
    query: 'how long do refunds take',
    limit: 5,
  );
  print(hits);
}
```

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

```dart
notifier.serverConfig = {
  'vectorStore': {'provider': 'postgres'},
  'embedding': {
    'provider': 'open_ai',
    'model': 'text-embedding-3-small',
    'dimensions': 1536,
  },
};

notifier.serverConfig = null;
```

## Override one call

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

```dart
await notifier.search(
  senderId: userId,
  query: 'refund timeline',
  vectorStore: {
    'provider': 'pinecone',
    'apiKey': pineconeApiKey,
    'host': pineconeHost,
    'namespace': 'help-center',
  },
);
```

`vectorStoreConfig` and `embeddingConfig` are the same options. A `serverConfig` argument applies to that call only:

```dart
await notifier.deleteDocument(
  senderId: userId,
  recordId: 'refund-policy',
  serverConfig: {
    'vectorStore': {'provider': 'qdrant', 'host': 'https://qdrant.example'},
    'embeddingConfig': {'provider': 'gemini', 'apiKey': geminiApiKey},
  },
);
```

The same named arguments work on `updateDocument`, `getDocument`, and `listDocuments`.

## Workflow context

`ctx.search` and the document helpers take the same options. `ctx.notifier.serverConfig` is used when the call leaves them out.

```dart
final hits = await ctx.search(
  query: 'refund policy',
  limit: 5,
  label: 'FAQ search',
  vectorStore: {'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/dart-flutter.md)
* [**Manage documents**](https://dnotifier.gitbook.io/product-docs/ai/manage-documents/dart-flutter.md)
