Skip to content

Search

Moneypenny provides a unified search system that queries across all data stores in a single call — facts, messages, tool calls, knowledge chunks, and policy audit records.

Because Moneypenny exposes its full API via MCP (Model Context Protocol), you can search through natural language in any MCP-compatible client (Claude Desktop, Cursor, etc.) — or through the CLI and canonical operations.

Search combines two retrieval methods:

  1. FTS5 full-text search — keyword and phrase matching with BM25 ranking
  2. Vector KNN search — semantic similarity using embeddings

Results from both methods are fused using Reciprocal Rank Fusion (RRF), which merges ranked lists without needing score normalization.

From the CLI

Terminal window
mp facts search "deployment pipeline"
mp knowledge search "security policy"

Via Canonical Operations

Terminal window
echo '{"op":"memory.search","args":{"query":"deployment","limit":10}}' | mp sidecar

Store-Weighted Scoring

Results are weighted by store type based on query intent:

StoreWeightPurpose
factsHighCurated, structured knowledge
knowledgeMedium-HighReference material from documents
messagesMediumConversation history
tool_callsLow-MediumTool execution records
policy_auditLowPolicy decisions

Weights adapt by intent detection — a question about “what happened” shifts weight toward messages and audit; a question about “how does X work” shifts toward facts and knowledge.

MMR Diversity Re-ranking

After fusion, results are re-ranked using Maximal Marginal Relevance (MMR) to avoid returning five near-identical results. MMR balances relevance against diversity, ensuring the top results cover different aspects of the query.

Embeddings

When an embedding provider is configured, Moneypenny generates vectors for:

  • Messages (conversation history)
  • Facts (structured memory)
  • Knowledge chunks (ingested documents)
  • Tool call records
  • Policy audit entries

Embeddings are generated incrementally — new content is vectorized on write or during a background pass. The default local model is nomic-embed-text-v1.5 (768 dimensions, GGUF format).

Search Without Embeddings

Vector search is optional. Without embeddings, search falls back to FTS5-only mode, which still provides high-quality keyword and phrase matching across all stores. Embeddings add semantic similarity but are not required.