# ADR-008: Research Workspace Search Index

- **Status:** Approved
- **Decision:** Use MiniSearch for workspace search and ranking
- **Implemented:** Sprint 1 Phase 3

## Context

Research workspaces need searchable document titles, sources, companies, tickers, categories, and content. ADR-0006 requires proven, well-tested algorithms, libraries, and patterns by default. A custom search or ranking algorithm would add unnecessary validation and model risk at this stage.

## Decision

Axiom will use the established `minisearch` library for in-memory workspace search.

The `MiniSearchResearchIndex` adapter:

- indexes normalized `ResearchDocument` fields;
- delegates matching and scoring to MiniSearch;
- enables prefix and fuzzy matching through library-supported options;
- returns documents with library-provided scores and matched terms.

## Evaluated Approaches

- **MiniSearch:** Selected. Mature, lightweight, dependency-friendly, and suitable for local in-memory workspace search.
- **Custom scoring:** Rejected. It would violate ADR-0006 without a documented limitation in existing approaches.
- **External search service:** Deferred. Operationally premature for Sprint 1 and unnecessary for local workspace search.

## Consequences

- Search ranking comes from a proven library rather than custom Axiom logic.
- Search behavior remains encapsulated behind `ResearchSearchIndex`.
- A future service-backed index can replace the adapter without changing workspace callers.

## Boundaries

- Search results are evidence retrieval aids, not trading recommendations.
- Search does not summarize, classify, or reason with an LLM.
- Ranking logic must not be replaced with custom logic without Girish approval under ADR-0006.
