KnowledgeGaps
Queries a knowledge base could not answer, grouped as open, indexed or dismissed, with hit counts, first and last asked, and actions to mark indexed, dismiss or reopen.
Code
import { KnowledgeGaps, type KnowledgeGap } from "@fadymondy/nasaq/web";export function Gaps({ gaps }: { gaps: KnowledgeGap[] }) { return ( <KnowledgeGaps gaps={gaps} onResolve={async (gap, status) => { const res = await api.setGapStatus(gap.id, status); if (!res.ok) return { error: res.message }; }} /> );}AI Agents · beta
Live examples and controls: KnowledgeGaps in the lab.
Install
npx shadcn@latest add https://docs.nasaqui.com/r/knowledge-gaps.jsonA triage list of questions people asked that the brain had no answer for. Each gap shows how often it came up and when, and can be marked indexed (you added the missing knowledge), dismissed, or reopened.
When to use
- A brain admin page that reviews unanswered questions.
- Any list where items move between open, done and dismissed with a server round trip.
When not to use
- Searching memories: use
SemanticSearch. - General status workflows: use
EntityListwith status filters.
Import
import { KnowledgeGaps } from "@fadymondy/nasaq/web";Quick start
import { KnowledgeGaps, type KnowledgeGap } from "@fadymondy/nasaq/web";
export function Gaps({ gaps }: { gaps: KnowledgeGap[] }) {
return (
<KnowledgeGaps
gaps={gaps}
onResolve={async (gap, status) => {
const res = await api.setGapStatus(gap.id, status);
if (!res.ok) return { error: res.message };
}}
/>
);
}Anatomy
A status filter (ToggleGroup) with counts, then a list per status. Each row: the query, a hits bar, first and last asked (DateTime), an optional resolution note, and Mark indexed, Dismiss or Reopen buttons. The same actions are in a context menu (ContextMenuActions).
API
| Prop | Type | Description |
|---|---|---|
gaps | KnowledgeGap[] | { id, query, hits, firstSeen, lastSeen, status, resolution? }. |
status / defaultStatus / onStatusChange | KnowledgeGapStatus | "all" | The active filter. |
onResolve | (gap, status) => void | { error? } | Promise | Called for each action. Return { error } to show it and keep the row unchanged. |
loading, error, onRetry | Loading skeleton, error state and retry. | |
contextMenu | boolean | Context menu on rows. Default true. |
labels | Partial<KnowledgeGapsLabels> | Override any string. |
Examples
Uncontrolled filter, open first
<KnowledgeGaps gaps={gaps} defaultStatus="open" onResolve={save} />Accessibility
Status is text plus an icon, never colour alone. Action buttons carry the query in their accessible name. A busy button shows a spinner and is disabled while the request runs. Errors are announced.
RTL & i18n
- English and Arabic strings ship and follow the Nasaq locale. Pass
labelsto override any string. - Layout uses logical properties, so it mirrors in right-to-left. Numbers and dates follow the locale.
Styling & tokens
- Status tones come from
Status(neutral, success, warning). The hits bar usesbg-nq-accentonbg-secondary.
Do / Don't
- Do return
{ error }fromonResolveinstead of throwing. - Don't hide the dismissed list; people reopen gaps.
Related
Lab
https://docs.nasaqui.com/?path=/docs/components-ai-agents-knowledge-gaps--docs
BrainList
Zekra-style list of AI brains as a table or cards with status, access, memory and source counts, members, tags and last activity, plus search, filters, bulk select and loading and empty states.
ModelRoutingEditor
Admin editor for AI model routing with an automatic-routing switch, a task class to model and fallback route table, an active backend switch and provider or node registration with modality chips.