Skip to main content
Skip unchanged files automatically — only modified content is re-indexed on each run, saving time on large document corpora.
The user queries the knowledge base; only changed files are re-indexed on each run.

Quick Start

1

Agent with incremental knowledge

On the second run, unchanged files are skipped automatically.
2

Direct index with result stats


How It Works


Configuration Options

Knowledge.index() parameters

IndexResult fields

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 and report results

Force full re-index

Selective indexing with glob patterns

Corpus statistics

Low-level file tracking


Best Practices

Create a .praisonignore in your corpus directory — it follows gitignore syntax and is auto-detected:
.gitignore is also read as a fallback.
Pass user_id or agent_id to isolate indexes per tenant. Without a scope identifier, the mem0 backend raises ScopeRequiredError.
CorpusStats.strategy_recommendation returns the optimal retrieval strategy based on file count:
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.

Knowledge Backends

Choose and configure the knowledge storage backend

Knowledge

Core knowledge retrieval and agent integration