Eidetic

AI Context Awareness

AI
Trust
Governor

Shows what context and information the AI has access to in the current conversation. Displays active documents, conversation history, user profile data, and external sources with access levels and freshness indicators.

Indicator Variant

Compact context badge with tooltip

3 context
1 stale

Compact Variant

Inline list of context items

Context
Chat history
project-spec.pdf
User preferences
API documentation

Panel Variant

Collapsible sidebar panel

Context usage78%
Chat history
Active5m ago
project-spec.pdf
Active30m ago
User preferences
Active2h ago
API documentation
Stale1d ago

Detailed Variant

Full breakdown with actions and token usage

Context Awareness

What the AI knows about this conversation

3
Total
3
Active
0
Stale
Context Window8,200 / 16,000 tokens
The AI uses this context to provide relevant responses

Props

AIContextAwareness component API reference

PropTypeDefaultDescription
contextItems*ContextItem[]List of context items the AI has access to
statsContextStatsOverall context statistics (calculated if not provided)
onRemoveContext(contextId: string) => voidCallback when user removes a context item
onRefreshContext(contextId: string) => voidCallback when user refreshes a context item
onToggleAccess(contextId: string, access: ContextAccess) => voidCallback when user toggles context access
showDetailsbooleanfalseWhether to show detailed view
variant'indicator' | 'compact' | 'panel' | 'detailed''indicator'Display mode variant
showTokenUsagebooleantrueShow token usage bar
showPrivacyIndicatorsbooleantrueShow privacy indicators for sensitive data
collapsiblebooleanfalseAllow collapsing in panel/detailed mode
defaultCollapsedbooleanfalseDefault collapsed state
classNamestringAdditional CSS classes

ContextItem Type

PropTypeDefaultDescription
id*stringUnique context identifier
type*'conversation' | 'document' | 'user_profile' | 'system' | 'external' | 'temporal'Type of context
label*stringDisplay label
descriptionstringDetailed description
status*'active' | 'stale' | 'expired' | 'refreshing'Freshness status
access*'full' | 'partial' | 'none'Access level
lastUpdatedDateLast update timestamp
expiresAtDateExpiration timestamp
sizestringFile size (for documents)
isPrivatebooleanWhether data is private/sensitive
canRemovebooleanWhether user can remove this context
canRefreshbooleanWhether context can be refreshed

Usage

Import and implementation example

import { AIContextAwareness } from '@/blocks/ai-transparency/ai-context-awareness'
export default function ChatInterface() {
const contextItems = [
{
id: '1',
type: 'conversation',
label: 'Chat history',
status: 'active',
access: 'full',
lastUpdated: new Date(),
},
{
id: '2',
type: 'document',
label: 'requirements.pdf',
status: 'active',
access: 'full',
size: '1.2 MB',
canRemove: true,
lastUpdated: new Date(),
},
{
id: '3',
type: 'user_profile',
label: 'Your preferences',
status: 'active',
access: 'partial',
isPrivate: true,
lastUpdated: new Date(),
},
]
const handleRemove = (id: string) => {
// Remove context item
}
const handleRefresh = (id: string) => {
// Refresh stale context
}
const handleToggleAccess = (id: string, access: string) => {
// Toggle access level
}
return (
<AIContextAwareness
contextItems={contextItems}
variant="panel"
showTokenUsage={true}
showPrivacyIndicators={true}
stats={{
totalItems: 3,
activeItems: 3,
staleItems: 0,
tokenUsage: 8500,
maxTokens: 16000,
}}
onRemoveContext={handleRemove}
onRefreshContext={handleRefresh}
onToggleAccess={handleToggleAccess}
/>
)
}

Built With

3 components

This block uses the following UI components from the design system:

Features

Built-in functionality

  • Multiple context types: Conversation, documents, user profile, system, external, temporal
  • Access level indicators: Full, partial, or no access visualization
  • Freshness tracking: Active, stale, expired, or refreshing status
  • Token usage visualization: Progress bar showing context window usage
  • Privacy indicators: Lock icons for sensitive/private data
  • Refresh capability: Update stale context with refresh button
  • Remove context: Allow users to remove unnecessary context
  • Access control: Toggle AI access to specific context items
  • Time formatting: Relative time display (e.g., "5m ago", "2h ago")
  • Dark mode support: Full dark mode with proper contrast

Accessibility

ARIA support and keyboard navigation

ARIA Attributes

Interactive buttons use semantic button elementsCollapse/expand states indicated with chevron iconsStatus indicators use both color and icons

Keyboard Navigation

KeyAction
TabNavigate through actions and items
Enter / SpaceActivate buttons

Notes

  • Color coding supplemented with icons and text labels
  • Privacy indicators clearly marked with lock icons
  • Token usage shown as both progress bar and text
  • Consider adding aria-live for dynamic context updates