Analytics Dashboard
The Analytics Dashboard API provides read-only operational metrics for indexed content quality and metadata rule performance. All analytics endpoints require a Pro plan or higher.
source_id works for both connectors and integrations.
Available Metrics
| Endpoint | What it measures |
|---|---|
GET /api/analytics/{source_id}/chunk-size-distribution | Histogram of chunk character lengths with mean/median/min/max stats |
GET /api/analytics/{source_id}/metadata-hit-rate | Per-rule: how many documents/chunks matched vs total applicable |
GET /api/analytics/{source_id}/metadata-coverage | Per-field: what fraction of chunks have a non-empty value |
GET /api/analytics/{source_id}/chunks-per-document | How many chunks each document produced, with summary stats |
GET /api/analytics/{source_id}/inheritance-ratio | For chunk-level rules: self-matched vs inherited vs empty breakdown |
GET /api/analytics/{source_id}/empty-metadata | Count of chunks with zero metadata fields, with sample doc IDs |
GET /api/analytics/{source_id}/rule-priority-audit | For fields with overlapping rules: which rule "won" most often |
Detailed Metric Explanations
Chunk Size Distribution
Returns a histogram of chunk character lengths so you can tune chunk_size settings. Results include 100-character buckets plus summary stats (mean, median, min, max).
Metadata Hit Rate
Shows per-rule effectiveness: how many documents (for document-level rules) or chunks (for chunk-level rules) matched each rule. Use this to identify rules that rarely match and may need pattern updates.
Metadata Coverage
Shows per-field coverage ratio across all chunks. This helps spot metadata fields that are present in too few chunks and may reduce filter reliability.
Chunks Per Document
Returns how many chunks each document produced, sorted by count descending, with summary stats. This helps identify oversized documents that may need different chunking settings.
Inheritance Ratio
For chunk-level rules, breaks down how values were assigned:
- self-matched (rule matched the chunk directly)
- inherited (value carried from a preceding chunk)
- empty (no value available)
Use this to verify chunk-level inheritance is working as expected.
Empty Metadata
Returns the total number of chunks with zero metadata fields and up to 10 sample doc_id values for investigation.
Rule Priority Audit
For metadata fields with two or more rules at different priorities, shows how many documents/chunks each rule "won". Use this to verify priority ordering is behaving correctly.
Usage Example
curl -s http://localhost:8000/api/analytics/<source_id>/metadata-coverage \
-H "Authorization: Bearer <ACCESS_TOKEN>"