index
Method
This is a method of the Knowledge class in the knowledge module.Index a directory or file for knowledge retrieval. Supports incremental indexing - only changed files are re-indexed.
Signature
Parameters
Directory or file path to index
If True, only index changed files (default: True)
If True, re-index all files regardless of changes
List of glob patterns to include (e.g., [“.py”, “.md”])
List of glob patterns to exclude (e.g., [“.log”, “test_”])
Optional user ID for scoping
Optional agent ID for scoping
Optional run ID for scoping
Returns
IndexResult with indexing statistics

