Skip to content
For the complete documentation index, see llms.txt. This page is also available as Markdown.

Knowledge base (RAG) overview

DNotifier's knowledge base lets you index text documents per app, then retrieve relevant chunks with semantic search or inject them automatically into AI prompts via useKnowledgeBase: true.

Transport: All knowledge-base APIs (addDocument, search, etc.) use HTTP transport. Connect with transport: "http" before calling them.

How RAG fits together

  Indexing (write path)                Query (read path)
  ─────────────────────                ─────────────────

  addDocument ──► embed & store        search ──► ranked chunks
       β”‚                                    β”‚
       β”‚                                    β”œβ”€β–Ί use in sendAI (useKnowledgeBase)
  updateDocument                           └─► use in workflow ctx.search()
  deleteDocument
  listDocuments / getDocument

RAG (retrieval-augmented generation) means: retrieve relevant documents, then let the AI answer using that context instead of guessing.

Document model

Each document is keyed by recordId (your stable id β€” FAQ slug, article id, ticket attachment id, etc.).

Field
Required
Description

recordId

Yes

Unique id within your app

content

Yes

Plain text body to index

type

No

Category label (text, faq, policy, …)

metadata

No

JSON object β€” e.g. { "source": "help-center" } for filtering

Documents are stored in Postgres and embedded with the model on your subscription unless you set serverConfig. Use that to choose Pinecone, Weaviate, Qdrant, Azure AI Search, S3 Vectors, or another embedding model.

β†’ Vector stores and embeddings

search returns chunks ranked by similarity to your query:

β†’ Semantic search

AI with knowledge base

Pass useKnowledgeBase: true in a chat-style sendAI message. DNotifier retrieves relevant chunks and includes them in the prompt:

β†’ Chat-style AI messages

Manage documents

Operation
Method

Add

addDocument

Update body/metadata

updateDocument

Get one + chunks

getDocument

List (paginated)

listDocuments

Delete

deleteDocument

β†’ Manage documents

Indexing strategies

Pattern
When to use

One record per article

Help center pages, policy docs

One record per FAQ

Short Q&A pairs with stable recordId

Re-index on publish

updateDocument when CMS content changes

Batch import

Loop addDocument from a migration script

Workflows + RAG

Inside a workflow, agents can call ctx.search() and ctx.sendAI() with observability labels β€” useful for intent routers and support bots.

β†’ Example: Intent router Β· Example: RAG bot

Next steps

Last updated