Skip to content

feat(search): add --intent bucket pre-filter for memory/import/connector #251

Closed

Description

@hurttlocker

Summary

Add intent-based pre-filtering to cortex search so operators can constrain retrieval to a source bucket before scoring.

CLI

  • cortex search "query" --intent <memory|import|connector|all>
  • all remains default behavior.

Behavior

  • Intent filter runs before ranking/scoring.
  • Reuse existing source categorization conventions; do not introduce a new search engine.

Intent mapping:

  • memory: daily memory notes / MEMORY.md style sources
  • connector: connector-prefixed sources (github:, gmail:, etc.)
  • import: non-memory, non-connector imported files
  • all: no intent filtering

MCP

  • Add intent parameter to cortex_search tool with same enum.

Constraints

  • Keep implementation simple: convenience wrapper over existing source/source-category logic.
  • Preserve compatibility with existing --source and --source-boost behavior.

Acceptance

  • Intent flag works in CLI and MCP.
  • Invalid intent returns clear validation error.
  • Add tests for normalization + filtering behavior.
  • go test ./... passes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions