textrawl
byJeff Green

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

ParameterTypeRequiredDefaultDescription
scopeenumNoallWhich 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

{ "scope": "memory" }

Returns only memory stats. Returns an error if the feature is disabled.

Response

Scope: all

{
  "knowledge": {
    "total": 150,
    "bySourceType": { "note": 80, "file": 65, "url": 5 },
    "byContentType": { "email": 30, "document": 120 },
    "topTags": [{ "tag": "work", "count": 45 }, { "tag": "planning", "count": 20 }],
    "dateRange": { "oldest": "2024-01-15T10:00:00Z", "newest": "2026-01-05T14:30:00Z" }
  },
  "memory": {
    "totalEntities": 25,
    "totalObservations": 150,
    "totalRelations": 30,
    "entityTypeCounts": { "person": 10, "project": 8, "concept": 5, "organization": 2 }
  },
  "conversations": {
    "totalSessions": 15,
    "sessionsWithSummary": 12,
    "totalTurns": 340,
    "turnsWithEmbedding": 280
  },
  "insights": {
    "total": 8,
    "new": 3,
    "seen": 4,
    "dismissed": 1,
    "byType": { "cross_reference": 5, "entity_bridge": 2, "theme": 1 },
    "queueState": { "chunks_pending": 0, "is_processing": false, "last_scan_at": "2026-01-05T10:00:00Z" }
  }
}

Compact Mode

When COMPACT_RESPONSES=true, stats use abbreviated keys. Knowledge stats pass through unchanged; memory, conversations, and insights use compact keys:

{
  "knowledge": { "total": 150, "bySourceType": { "note": 80 }, "byContentType": { "email": 30 }, "topTags": [{ "tag": "work", "count": 45 }], "dateRange": { "oldest": "...", "newest": "..." } },
  "memory": { "ent": 25, "obs": 150, "rel": 30, "byType": { "person": 10 } },
  "conversations": { "sess": 15, "indexed": 12, "turns": 340, "turnIdx": 280 },
  "insights": { "n": 8, "new": 3, "seen": 4, "dis": 1, "types": {}, "q": { "p": 0, "proc": false, "last": "..." } }
}

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.

FieldTypeDescription
knowledgeobjectKnowledge base stats (when scope includes knowledge)
knowledge.totalintegerTotal documents
knowledge.bySourceTypeobjectCount by source type
knowledge.byContentTypeobjectCount by content type
knowledge.topTagsarrayTop tags with counts
knowledge.topTags[].tagstringTag name
knowledge.topTags[].countintegerNumber of documents with this tag
knowledge.dateRangeobjectOldest/newest document dates
knowledge.dateRange.oldeststring?ISO timestamp of oldest document
knowledge.dateRange.neweststring?ISO timestamp of newest document
memoryobjectMemory stats (when scope includes memory)
memory.totalEntitiesintegerTotal entities
memory.totalObservationsintegerTotal observations
memory.totalRelationsintegerTotal relations
memory.entityTypeCountsobjectCount by entity type
conversationsobjectConversation stats (when scope includes conversations)
conversations.totalSessionsintegerTotal sessions
conversations.sessionsWithSummaryintegerSessions with summaries
conversations.totalTurnsintegerTotal turns
conversations.turnsWithEmbeddingintegerTurns with embeddings
insightsobjectInsight stats (when scope includes insights)
insights.totalintegerTotal insights
insights.newintegerNew insights
insights.seenintegerSeen insights
insights.dismissedintegerDismissed insights
insights.byTypeobjectCount by insight type
insights.queueStateobject?Processing queue state (null if unavailable)
insights.queueState.chunks_pendingintegerChunks awaiting processing
insights.queueState.is_processingbooleanWhether a scan is in progress
insights.queueState.last_scan_atstring?ISO timestamp of last scan

Scope Behavior

ScopeFeature FlagBehavior
all-Returns all enabled features, silently skips disabled ones
knowledgealways availableReturns knowledge base stats
memoryENABLE_MEMORYReturns memory stats, error if disabled
conversationsENABLE_CONVERSATIONSReturns conversation stats, error if disabled
insightsENABLE_INSIGHTSReturns insight stats, error if disabled or schema not initialized

Use Cases

Health Check

Verify all systems are working:

{ "scope": "all" }

Capacity Planning

Monitor specific subsystem growth:

{ "scope": "knowledge" }

Debugging

Check if memories are being created as expected:

{ "scope": "memory" }

Errors

ErrorCauseFix
Database not configuredMissing Supabase credentialsSet SUPABASE_URL and SUPABASE_SERVICE_KEY
Memory feature disabledENABLE_MEMORY=false and scope=memorySet ENABLE_MEMORY=true
Conversations feature disabledENABLE_CONVERSATIONS=false and scope=conversationsSet ENABLE_CONVERSATIONS=true
Insights feature disabledENABLE_INSIGHTS=false and scope=insightsSet ENABLE_INSIGHTS=true
Insight schema not initializedMissing insight tablesRun the insight schema SQL
  • search - Search across the knowledge base
  • query_memory - Query memory graph
  • query_conversations - Query past conversations
  • get_insights - View discovered insights

On this page