get_stats
Get statistics across all features
Get statistics about the knowledge base, memory graph, conversations, and insights. Use scope to select which stats to return.
Parameters
| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
scope | enum | No | all | Which stats to return: all, knowledge, memory, conversations, insights |
Example Requests
All Stats
Returns stats for all enabled features. Disabled features are silently skipped.
Specific Scope
Returns only memory stats. Returns an error if the feature is disabled.
Response
Scope: all
Compact Mode
When COMPACT_RESPONSES=true, stats use abbreviated keys. Knowledge stats pass through unchanged; memory, conversations, and insights use compact keys:
Output Schema
This tool MUST return structuredContent alongside the text response. The structuredContent object MUST use canonical verbose keys regardless of the COMPACT_RESPONSES setting.
| Field | Type | Description |
|---|---|---|
knowledge | object | Knowledge base stats (when scope includes knowledge) |
knowledge.total | integer | Total documents |
knowledge.bySourceType | object | Count by source type |
knowledge.byContentType | object | Count by content type |
knowledge.topTags | array | Top tags with counts |
knowledge.topTags[].tag | string | Tag name |
knowledge.topTags[].count | integer | Number of documents with this tag |
knowledge.dateRange | object | Oldest/newest document dates |
knowledge.dateRange.oldest | string? | ISO timestamp of oldest document |
knowledge.dateRange.newest | string? | ISO timestamp of newest document |
memory | object | Memory stats (when scope includes memory) |
memory.totalEntities | integer | Total entities |
memory.totalObservations | integer | Total observations |
memory.totalRelations | integer | Total relations |
memory.entityTypeCounts | object | Count by entity type |
conversations | object | Conversation stats (when scope includes conversations) |
conversations.totalSessions | integer | Total sessions |
conversations.sessionsWithSummary | integer | Sessions with summaries |
conversations.totalTurns | integer | Total turns |
conversations.turnsWithEmbedding | integer | Turns with embeddings |
insights | object | Insight stats (when scope includes insights) |
insights.total | integer | Total insights |
insights.new | integer | New insights |
insights.seen | integer | Seen insights |
insights.dismissed | integer | Dismissed insights |
insights.byType | object | Count by insight type |
insights.queueState | object? | Processing queue state (null if unavailable) |
insights.queueState.chunks_pending | integer | Chunks awaiting processing |
insights.queueState.is_processing | boolean | Whether a scan is in progress |
insights.queueState.last_scan_at | string? | ISO timestamp of last scan |
Scope Behavior
| Scope | Feature Flag | Behavior |
|---|---|---|
all | - | Returns all enabled features, silently skips disabled ones |
knowledge | always available | Returns knowledge base stats |
memory | ENABLE_MEMORY | Returns memory stats, error if disabled |
conversations | ENABLE_CONVERSATIONS | Returns conversation stats, error if disabled |
insights | ENABLE_INSIGHTS | Returns insight stats, error if disabled or schema not initialized |
Use Cases
Health Check
Verify all systems are working:
Capacity Planning
Monitor specific subsystem growth:
Debugging
Check if memories are being created as expected:
Errors
| Error | Cause | Fix |
|---|---|---|
| Database not configured | Missing Supabase credentials | Set SUPABASE_URL and SUPABASE_SERVICE_KEY |
| Memory feature disabled | ENABLE_MEMORY=false and scope=memory | Set ENABLE_MEMORY=true |
| Conversations feature disabled | ENABLE_CONVERSATIONS=false and scope=conversations | Set ENABLE_CONVERSATIONS=true |
| Insights feature disabled | ENABLE_INSIGHTS=false and scope=insights | Set ENABLE_INSIGHTS=true |
| Insight schema not initialized | Missing insight tables | Run the insight schema SQL |
Related Tools
search- Search across the knowledge basequery_memory- Query memory graphquery_conversations- Query past conversationsget_insights- View discovered insights