Skip to content

feat: workspace per-document deletion from index #5852

@kshitijk4poor

Description

@kshitijk4poor

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

  1. Add action="delete" to workspace_tool schema with required path parameter
  2. Add workspace_delete_file(rel_path, config) in agent/workspace.py
  3. Open index store session, call delete_file(rel_path), commit
  4. Add /workspace delete <path> slash subcommand
  5. Add hermes workspace delete <path> CLI subcommand

The SqliteIndexSession.delete_file() method already exists.

Related

Part of workspace foundation (#5840)

Metadata

Metadata

Assignees

No one assigned

    Labels

    P3Low — cosmetic, nice to havetype/featureNew feature or request

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions