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

# AI use cases

**AI** on DNotifier covers managed prompts, multi-turn **sessions**, **knowledge base (RAG)**, and **semantic search** — plus **workflows and agents** for multi-step automation. AI runs through SDK methods like `sendAI` and `search`, typically over **HTTP transport** for request/response calls.

{% hint style="info" %}
**AI**, **Chat**, and **Realtime communication** are separate capabilities. AI does not require WebSocket chat — but you can combine them for copilots in messaging UIs. See [Combined use cases](https://dnotifier.gitbook.io/product-docs/platform-overview/use-cases/combined.md).
{% endhint %}

***

## Platform AI capabilities

| Capability              | SDK surface                           | Use for                               |
| ----------------------- | ------------------------------------- | ------------------------------------- |
| **Simple prompts**      | `sendAI` with `{ text }`              | Summaries, classification, generation |
| **Chat-style AI**       | `sendAI` with `messages[]`            | Multi-role conversations              |
| **Sessions**            | `sessionId` on follow-up calls        | Continuity across turns               |
| **RAG**                 | `useKnowledgeBase: true` + documents  | Answers grounded in your content      |
| **Document management** | `addDocument`, `updateDocument`, etc. | Ingest help docs, catalogs, policies  |
| **Semantic search**     | `search`                              | Find relevant passages without LLM    |
| **Workflows & agents**  | `defineAgent`, `Workflow`             | Routing, pipelines, observability     |

→ [AI overview](https://dnotifier.gitbook.io/product-docs/ai/overview.md) · [Workflows overview](https://dnotifier.gitbook.io/product-docs/workflows-and-agents/overview.md)

***

## Customer support agents

First-line support that answers FAQs, triages tickets, and escalates edge cases.

### Pattern

| Layer                    | Implementation                                       |
| ------------------------ | ---------------------------------------------------- |
| **Knowledge base**       | Ingest help center articles with `addDocument`       |
| **Support agent prompt** | System message: tone, escalation rules, product name |
| **RAG**                  | `useKnowledgeBase: true` on `sendAI`                 |
| **Session**              | Same `sessionId` per ticket for context              |
| **Escalation**           | Workflow branch or your app hands off to human chat  |

### Example flow

1. User asks "How do I change my billing address?"
2. App calls `sendAI` with support system prompt and RAG enabled.
3. Model retrieves relevant docs via knowledge base; returns steps.
4. If confidence is low, workflow routes to human — [Combined use cases](https://dnotifier.gitbook.io/product-docs/platform-overview/use-cases/combined.md).

→ [Build an AI assistant](https://dnotifier.gitbook.io/product-docs/ai/example-ai-assistant.md) · [Session logging](https://dnotifier.gitbook.io/product-docs/ai/session-logging.md)

***

## Knowledge bots and RAG

Products that must answer from **your** data — documentation, compliance text, product specs — not the model's training cutoff.

### Pattern

| Step       | Action                                                                    |
| ---------- | ------------------------------------------------------------------------- |
| **Ingest** | `addDocument` with `recordId`, `content`, optional `metadata`             |
| **Update** | `updateDocument` when source content changes                              |
| **Search** | `search` with `query`, `minSimilarity`, filters                           |
| **Answer** | `sendAI` with `useKnowledgeBase: true` or inject search hits into prompts |
| **Govern** | `deleteDocument`, plan word limits                                        |

### Example flow

1. Index 500 help articles into the knowledge base.
2. User query → `search` returns top passages.
3. Optional: workflow agent summarizes hits → final answer via `sendAI`.

→ [Build a RAG Q\&A bot](https://dnotifier.gitbook.io/product-docs/ai/example-rag-bot.md) · [Semantic search](https://dnotifier.gitbook.io/product-docs/ai/semantic-search.md)

***

## Internal assistants

Employee copilots for HR policies, engineering runbooks, sales battlecards, and onboarding.

### Pattern

| Concern            | Approach                                                          |
| ------------------ | ----------------------------------------------------------------- |
| **Access control** | Separate app or user IDs per tenant; documents scoped by metadata |
| **Freshness**      | Scheduled jobs call `updateDocument` when sources change          |
| **Audit**          | Enable `logs: true` for session logging in dashboard              |
| **Complex tasks**  | Workflows with specialist agents                                  |

### Example flow

1. Engineer asks "What's our incident escalation path?"
2. `sendAI` + RAG over runbook documents.
3. Session logged for compliance review.

→ [Manage documents](https://dnotifier.gitbook.io/product-docs/ai/manage-documents.md) · [AI sessions](https://dnotifier.gitbook.io/product-docs/ai/sessions.md)

***

## RAG applications

Retrieval-augmented generation spans support, legal review, research tools, and in-product search.

### Architecture options

| Style                  | Description                                        |
| ---------------------- | -------------------------------------------------- |
| **Search-only**        | `search` API surfaces snippets in UI without LLM   |
| **Search + summarize** | Workflow: search agent → writer agent              |
| **Inline RAG**         | Single `sendAI` call with `useKnowledgeBase: true` |

### Metadata filters

Tag documents with `metadata: { source, product, locale }` and filter searches with `filterbySource` (and similar fields) so users only see allowed content.

→ [Knowledge base overview](https://dnotifier.gitbook.io/product-docs/ai/knowledge-base-overview.md)

***

## Multi-agent and workflow use cases

When a single prompt is insufficient, use **agents** and **workflows**:

| Scenario              | Workflow shape                                         |
| --------------------- | ------------------------------------------------------ |
| **Intent routing**    | Classifier agent → search or general Q\&A branch       |
| **Content pipeline**  | Research agent → draft agent → editor agent            |
| **Approval flows**    | Generator agent → human step (your UI) → publish agent |
| **Parallel research** | Multiple agents; merge in workflow state               |

Enable **observability** to trace each execution in the dashboard.

→ [Example: Intent router](https://dnotifier.gitbook.io/product-docs/workflows-and-agents/example-intent-router.md) · [Example: Multi-agent pipeline](https://dnotifier.gitbook.io/product-docs/workflows-and-agents/example-multi-agent.md)

***

## AI + realtime (without chat)

Not every AI feature is a chat thread. Use **realtime 1:1 messaging** to push AI results or progress to a user ID:

* `{ type: "ai-complete", answer }` when async workflow finishes
* `{ type: "ai-progress", step }` during long workflow runs

→ [Realtime communication use cases](https://dnotifier.gitbook.io/product-docs/platform-overview/use-cases/realtime-communication.md#live-progress-tracking)

***

## Plan and transport notes

| Topic          | Guidance                                                                                                                         |
| -------------- | -------------------------------------------------------------------------------------------------------------------------------- |
| **AI enabled** | Check `aiEnabled` and `getPlanLimits()` after connect                                                                            |
| **Transport**  | Prefer `transport: "http"` for AI/RAG RPC                                                                                        |
| **Quotas**     | AI requests and knowledge base words — [Pricing & plans](https://dnotifier.gitbook.io/product-docs/platform-overview/pricing.md) |
| **History**    | `fetchAIHistory`, `deleteAIHistoryMessage` for user-facing AI threads                                                            |

→ [Send a prompt](https://dnotifier.gitbook.io/product-docs/ai/send-prompt.md) · [AI history](https://dnotifier.gitbook.io/product-docs/ai/ai-history.md)

***

## Examples

| Example              | Level        | Link                                                                                                        |
| -------------------- | ------------ | ----------------------------------------------------------------------------------------------------------- |
| AI Q\&A              | Intermediate | [examples/ai-qa](https://dnotifier.gitbook.io/product-docs/examples/ai-qa.md)                               |
| RAG assistant        | Advanced     | [examples/rag-assistant](https://dnotifier.gitbook.io/product-docs/examples/rag-assistant.md)               |
| Multi-agent workflow | Advanced     | [examples/multi-agent-workflow](https://dnotifier.gitbook.io/product-docs/examples/multi-agent-workflow.md) |
