Skip to content

Add granular 'obsidian' EntrySource to distinguish plugin-imported content from other sources #1239

@chillu

Description

@chillu

Currently, all content imported via the Obsidian plugin is marked with EntrySource = "computer", which is also used for other types of imports (such as desktop client or manual ingestion). This lack of granularity in the source attribution means:

  • It's impossible to specifically target only Obsidian-imported content for actions (e.g. bulk deletion) from the UI or API;
  • All "computer" entries are lumped together, and deleting Obsidian content inadvertently affects unrelated entries.

For example, in src/khoj/routers/api_content.py, the EntrySource type only allows "computer", "github", or "notion", which are saved as DBEntry.file_source in the database. There is no way to distinguish between Obsidian-originated content and other sources with the current model.

Proposed Solution:

  • Add a new EntrySource value (e.g. "obsidian") in both frontend and backend to mark entries originating from the Obsidian plugin.
  • Update validation, ingestion, and query logic to recognize and persist "obsidian" as a valid source.
  • Adapt deletion, filtering, and API/listing features to allow distinguishing content by its specific EntrySource.

Motivation/Use-case:

  • Safely perform operations (delete, filter, query, list) that affect only Obsidian-imported content.
  • Prevent accidental data loss when deleting or modifying content ingested by other pathways.
  • Enable better tracking and debugging of content origins.

Metadata

Metadata

Assignees

No one assigned

    Labels

    improveUpgrade or improve an existing feature or capability

    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