Quick Start
1
Agent with incremental knowledge
2
Direct index with result stats
How It Works
Configuration Options
Knowledge.index() parameters
IndexResult fields
Partial failures count. If nine files out of ten embed successfully and one fails,
result.success is False and result.errors names the one that failed. files_indexed still reports the nine that landed, so the caller can log both the loss and the win.CorpusStats fields
FileTracker API
FileTracker records which vector-store chunks belong to each file so a re-index can remove stale content first.
Why this matters: editing a file and re-indexing no longer leaves the old chunks behind, so search results reflect only the current content. IDs that fail to delete are retried on the next re-index — they are never orphaned.
What gets deleted — inspect the chunks that will be removed when a file changes:
Common Patterns
Check success and errors together
Check and report results
Force full re-index
Selective indexing with glob patterns
Corpus statistics
Low-level file tracking
Best Practices
Use .praisonignore to exclude noisy files
Use .praisonignore to exclude noisy files
Create a
.praisonignore in your corpus directory — it follows gitignore syntax and is auto-detected:.gitignore is also read as a fallback.Scope indexes per user for multi-tenant apps
Scope indexes per user for multi-tenant apps
Pass
user_id or agent_id to isolate indexes per tenant. Without a scope identifier, the mem0 backend raises ScopeRequiredError.Inspect strategy_recommendation for large corpora
Inspect strategy_recommendation for large corpora
CorpusStats.strategy_recommendation returns the optimal retrieval strategy based on file count:Schedule periodic full re-indexes
Schedule periodic full re-indexes
Weekly
force=True re-indexes are still a good hygiene practice for hash-collision paranoia and to recover any IDs that repeatedly fail to delete, but they are no longer required to keep the vector store from growing unbounded on edited files — a changed file’s stale chunks are now deleted before its new chunks are added.Related
Knowledge Indexing Errors
See also — how
add() and index() surface per-file failures togetherKnowledge Backends
Choose and configure the knowledge storage backend
Knowledge
Core knowledge retrieval and agent integration

