Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions AGENT.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,21 @@
- **Logic**: Use the `IProjection` interface for dimensionality reduction algorithms.
- **State**: Centralized in the `state` object in `src/app.ts`.
- **Storage**: Use `src/db.ts` for IndexedDB operations.
- **Secrets**: API keys never enter `state`, `mc_settings`, a URL, or `console.error` — the last of these
is shipped to a remote error sink by `captureConsoleIntegration` (`src/sentry.ts:15`). See
[ADR-0002](docs/adr/0002-openai-compatible-remote-inference.md).
- **Embedding space**: index-time and query-time vectors must come from the same embedder with the same
prompt prefixes. Any change of embedder, model, or dimension must change the IndexedDB cache namespace

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Preserve role-specific embedding prefixes

Requiring index-time and query-time vectors to use the same prompt prefixes contradicts the existing Nomic contract: indexing uses search_document: at src/app.ts:1590, while querying uses search_query: at src/app.ts:627, and the new plan explicitly preserves that distinction. Following this guide literally would place one side in the wrong task space and degrade semantic search; describe the invariant as using the same embedder with that model's required role-specific prefix scheme, not identical prefixes.

Useful? React with 👍 / 👎.

(`currentCachePrefix`, `src/app.ts:354`).

## Architecture

### Application Modes
1. **AI Mode** (default): Loads embeddings, runs projections, enables semantic search
2. **Viewer-Only Mode**: Skips AI, arranges by folder/date grid, no search
3. **Remote AI Mode** (proposed, opt-in): inference runs against a user-configured OpenAI-compatible
endpoint instead of in the browser — downscaled JPEG thumbnails are uploaded. See
[ADR-0002](docs/adr/0002-openai-compatible-remote-inference.md) and `REMOTE_INFERENCE_PLAN.md`.

### State Management
- All state in `state` object (phase, files, vectors, points, clusters, thumbnails, settings)
Expand Down
Loading
Loading