Problem
No way to remove a specific file from the workspace index without re-indexing everything.
Research
- PrivateGPT:
DELETE /v1/ingest/{doc_id} deletes from both vector store and docstore
- Khoj:
Entry.objects.filter(file_path=path).delete()
- Continue.dev: Full re-index per IndexTag, no per-file deletion
Proposed approach
- Add
action="delete" to workspace_tool schema with required path parameter
- Add
workspace_delete_file(rel_path, config) in agent/workspace.py
- Open index store session, call
delete_file(rel_path), commit
- Add
/workspace delete <path> slash subcommand
- Add
hermes workspace delete <path> CLI subcommand
The SqliteIndexSession.delete_file() method already exists.
Related
Part of workspace foundation (#5840)
Problem
No way to remove a specific file from the workspace index without re-indexing everything.
Research
DELETE /v1/ingest/{doc_id}deletes from both vector store and docstoreEntry.objects.filter(file_path=path).delete()Proposed approach
action="delete"to workspace_tool schema with requiredpathparameterworkspace_delete_file(rel_path, config)inagent/workspace.pydelete_file(rel_path), commit/workspace delete <path>slash subcommandhermes workspace delete <path>CLI subcommandThe
SqliteIndexSession.delete_file()method already exists.Related
Part of workspace foundation (#5840)