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.
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 / getDocumentRAG (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.).
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
Semantic search
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:
Manage documents
Add
addDocument
Update body/metadata
updateDocument
Get one + chunks
getDocument
List (paginated)
listDocuments
Delete
deleteDocument
β Manage documents
Indexing strategies
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
Manage documents β CRUD operations
Semantic search β Query tuning
Vector stores and embeddings β Postgres, external stores, and embedding providers
Build a RAG Q&A bot β End-to-end example
Last updated