How finesssee/memory-search works
memory-search is a personal knowledge-base indexing and semantic-search CLI, with an HTTP API and agent integrations. The main workflow indexes configured files into SQLite, then accepts a query, expands it optionally, combines keyword and vector retrieval, reranks candidates, and formats results. Separate capabilities cover facts, session capture, context generation, collections, and IDE integrations. The graph follows documented behavior and indexed imports; unsampled commands and optional provider wiring are represented only where README evidence supports them.
Main entry points: indexer.ts File indexer · searcher.ts Hybrid search · embeddings.ts Embedding service · db.ts SQLite index
Components 24
User entry points
- CLI startup
src/cli.ts - Command router
src/commands/index.ts - Search command
src/commands/search.ts - Index command
src/commands/index-cmd.ts
Indexing pipeline
- File indexer
src/core/indexer.ts - Markdown chunker
src/core/chunker.ts - Chunk contextualizer
src/core/contextualizer.ts - Chunk annotations
src/core/observation-detector.ts - Concept extraction
src/core/concept-extractor.ts
Search and AI
- Hybrid search
src/core/searcher.ts - Query expansion
src/core/expander.ts - Embedding service
src/core/embeddings.ts - Cross-encoder reranker
src/core/reranker.ts - Local LLM runtime
src/core/local-llm.ts
Knowledge state
- SQLite index
src/storage/db.ts - Facts store
src/storage/facts.ts
Agent and service integrations
- Session capture
src/hooks/session-end.ts - Capture utilities
src/hooks/index.ts - Context builder
src/commands/context.ts - CLAUDE.md sync
src/integrations/claude-md.ts - HTTP API
src/server/routes.ts - Cursor integration
src/integrations/cursor.ts
Other components
- User
- Embedding endpoint
Connections 30
- User → CLI startup: runs commands
README.md - CLI startup → Command router: dispatches
src/cli.ts - Command router → Search command: routes search
src/commands/index.ts - Command router → Index command: routes indexing
src/commands/index.ts - Search command → Hybrid search: calls search
src/commands/search.ts - Index command → File indexer: starts indexing
README.md - File indexer → Markdown chunker: chunks files
src/core/indexer.ts - File indexer → Chunk contextualizer: contextualizes chunks
src/core/indexer.ts - File indexer → Embedding service: embeds chunks
src/core/indexer.ts - File indexer → SQLite index: stores index
src/core/indexer.ts - File indexer → Chunk annotations: detects types
src/core/indexer.ts - File indexer → Concept extraction: extracts concepts
src/core/indexer.ts - Hybrid search → Query expansion: expands query
src/core/searcher.ts - Hybrid search → Embedding service: embeds query
src/core/searcher.ts - Hybrid search → SQLite index: retrieves candidates
src/core/searcher.ts - Hybrid search → Cross-encoder reranker: reranks candidates
src/core/searcher.ts - Embedding service → SQLite index: caches vectors
src/core/embeddings.ts - Embedding service → Embedding endpoint: requests vectors
src/core/embeddings.ts - Cross-encoder reranker → Local LLM runtime: supports local mode
README.md - Embedding service → Local LLM runtime: supports local mode
README.md - Session capture → Capture utilities: uses capture utilities
src/hooks/session-end.ts - Session capture → SQLite index: stores session data
src/hooks/session-end.ts - Session capture → Facts store: stores extracted facts
src/hooks/session-end.ts - Context builder → Hybrid search: builds from search
src/commands/context.ts - Context builder → Facts store: reads facts
src/commands/context.ts - Context builder → CLAUDE.md sync: syncs context
src/commands/context.ts - HTTP API → Hybrid search: serves search
src/server/routes.ts - HTTP API → File indexer: serves indexing
src/server/routes.ts - HTTP API → SQLite index: reads status and chunks
src/server/routes.ts - User → Cursor integration: installs integration
README.md