Screen Flows — Knowledge Base
Screen IDs reference screens-knowledge-base.md.
Audience: Tenant admins (Dashboard) and DM Portal reviewers.
Platform: Web only.
Entry point: Dashboard Settings sidebar → Knowledge Base → /settings/knowledge-base
Status: [To Build] — The entire Knowledge Base / RAG system is new. No KB screens exist in the current live app. All flows below are specifications for what needs to be built.
1. Overview → Dataset Management
2. Dataset Detail — KB2
KB2 is a three-tab screen for a specific dataset.
3. Upload File Modal — KB3
4. Retrieval Sandbox — KB4
5. Dataset Configuration — KB5
Note: Embedding model is read-only after dataset creation. Changing the model would invalidate all existing vectors — users must create a new dataset instead.
6. Website Crawl Settings Modal — KB6
Schedule options: Weekly (every Monday at 3am) · Monthly · Manual only.
7. RAG Context in Other Apps
Knowledge Base content surfaces in two other apps when agents use rag_search.
Dashboard — Campaign Detail Activity tab
Activity cards show a collapsible “Retrieved context” section listing:
- Each RAG query the agent made
- Dataset searched, chunk count, relevance scores
- Chunk preview text and source file
DM Portal — Activity Detail (P3)
Same “Retrieved context” section appears in the right metadata pane alongside cost, token count, and model info. This lets reviewers identify poor retrieval quality and flag that a re-crawl or re-index is needed.
Manage — Tenant Detail Knowledge Base tab (M3)
Super admins see a read-only dataset summary per tenant:
| Dataset | Files | Chunks | Embedding Model | Status |
|---|---|---|---|---|
| Client Documents | 3 | 29 | text-embed-3-small | ✅ |
| Website Content | 142 pages | 1,840 | text-embed-3-small | ✅ weekly crawl |
| Published Content | 24 | 312 | text-embed-3-small | ✅ auto |
| Competitor Research | 18 | 210 | nomic-embed-text | ✅ local |
Admins can trigger re-index or clear a dataset on behalf of a tenant; all actions are written to audit_logs.
8. Screen Index
| Screen | Route | Trigger |
|---|---|---|
| KB1 — Overview | /settings/knowledge-base | Settings sidebar |
| KB2 — Files tab | /settings/knowledge-base/[datasetId] | ”View All Files” / “View Pages” etc. |
| KB3 — Upload modal | (modal on KB2) | ”+ Upload Files” button |
| KB4 — Sandbox tab | /settings/knowledge-base/[datasetId]/sandbox | ”Sandbox” tab or “Test Retrieval” link |
| KB5 — Configure tab | /settings/knowledge-base/[datasetId]/configure | ”Configure” tab |
| KB6 — Crawl settings | (modal on KB1) | “Re-crawl Now” or gear icon on Website Content card |