← Blog
April 13, 2026

MentisDB 0.8.8 — Episode Provenance, LLM Reranking & Cross-Chain Fixes

0.8.8 completes the 0.8.7 roadmap with two remaining features and an important bug fix. It adds optional LLM-based reranking for improved relevance on complex queries, a source_episode field for grouping thoughts by conversational context, and fixes a cross-chain relation traversal bug that could cause lookup failures.

Source Episodes — Group Thoughts by Context

Thoughts can now carry a source_episode label — an optional identifier for the conversational or contextual origin of a thought. This groups thoughts from the same conversation turn, debugging session, planning meeting, or reasoning chain.

Useful for:

Set via source_episode on append. Filter in queries with with_source_episode(). Like entity_type, this field is not included in the thought hash — backward compatible with all existing chains.

Opt-In LLM Reranking

Ranked search now supports an optional LLM-based reranking pass. When enabled, the top candidates from the existing BM25+vector+graph pipeline are sent to an LLM (OpenAI or Anthropic) which re-ranks them by relevance to the query. This helps most on complex multi-hop questions where the lexical and vector signals disagree on the best results.

How it works

  1. Run the normal ranked search pipeline to get top-k candidates
  2. Send query + candidate contents to the LLM with a ranking prompt
  3. LLM returns ordered indices; results are reordered
  4. If the LLM call fails, fall back to the original ranking (graceful degradation)

Parameters

ParameterTypeDefaultDescription
llm_rerankboolfalseEnable LLM reranking
llm_modelstringModel to use (e.g. "gpt-4", "claude-3-sonnet")
llm_rerank_top_kint20How many candidates to send to LLM

Works with mentisdb_ranked_search (MCP), POST /v1/search/rerank (REST), and the Rust RankedSearchQuery::with_llm_reranking(model, top_k) API.

Cross-Chain Relation Traversal Fix

A bug in resolve_context_by_id caused cross-chain relations (those with chain_key set) to be incorrectly processed during local traversal, potentially causing lookup failures. Fixed to properly skip cross-chain targets. The underlying cross-chain graph expansion via BranchesFrom was already working correctly.

Search Sanity Tests

Added 14 new regression tests covering the query pipeline: tags_any filter, type filter, empty results, text search case-insensitivity, importance threshold, entity_type filtering, cross-chain traversal, and LLM reranking behavior.

Upgrade Instructions

cargo install mentisdb --force