fleet-memory/hindsight-api/hindsight_api/engine
Nicolò Boschi 61bf428ba9
perf: fetch all recall chunks in a single query instead of batched while-loop (#475)
Replace the multi-round-trip while-loop in step 5.5 of recall_async with a
single WHERE chunk_id = ANY($1) query covering all candidate chunk IDs.
Token-budget accounting happens in Python after the single fetch.

Measured on a 97K-unit / 98M-link bank (budget=HIGH, include_chunks,
include_entities):
  p50:  1.209s → 0.611s  (−49%)
  mean: 1.534s → 0.772s  (−50%)
  p95:  3.366s → 2.316s  (−31%)

Also update recall_perf.py benchmark to use Budget.HIGH, include_chunks,
include_entities, and a realistic mixed fact_type distribution.
2026-03-03 14:52:48 +01:00
..
consolidation feat: add configurable Gemini/Vertex AI safety settings (#473) 2026-03-03 13:48:29 +01:00
directives feat: revisit mental models, directives and reflections (#179) 2026-01-22 17:13:16 +01:00
mental_models feat: revisit mental models, directives and reflections (#179) 2026-01-22 17:13:16 +01:00
parsers feat: add iris as file parser (#395) 2026-02-18 14:09:56 +01:00
providers feat: add configurable Gemini/Vertex AI safety settings (#473) 2026-03-03 13:48:29 +01:00
reflect feat: entity labels — optional, free_values, multi_value, UI polish (#450) 2026-03-02 13:05:25 +01:00
retain fix(performance): improve recall and retain performance on large banks (#469) 2026-03-03 13:35:22 +01:00
search fix(performance): improve recall and retain performance on large banks (#469) 2026-03-03 13:35:22 +01:00
storage fix(storage): use dynamic schema_getter in PostgreSQLFileStorage for multi-tenant (#440) 2026-02-25 15:19:08 +01:00
__init__.py feat: extensions (#54) 2025-12-22 11:05:23 +01:00
cross_encoder.py fix: zeroentropy rerank URL missing /v1 prefix and MCP retain async_processing param (#460) 2026-03-02 10:32:01 +01:00
db_budget.py fix: batch queries on recall (#149) 2026-01-13 13:20:22 +01:00
db_utils.py fix(performance): improve recall and retain performance on large banks (#469) 2026-03-03 13:35:22 +01:00
embeddings.py fix: pass encoding_format="float" in LiteLLM embedding calls (#434) 2026-02-25 10:32:05 +01:00
entity_resolver.py fix(performance): improve recall and retain performance on large banks (#469) 2026-03-03 13:35:22 +01:00
interface.py feat: add tags filtering and q description fix for list documents API (#468) 2026-03-02 17:03:16 +01:00
llm_interface.py feat: support Batch API for retain (openai/groq) (#365) 2026-02-16 13:31:50 +01:00
llm_wrapper.py feat: add configurable Gemini/Vertex AI safety settings (#473) 2026-03-03 13:48:29 +01:00
memory_engine.py perf: fetch all recall chunks in a single query instead of batched while-loop (#475) 2026-03-03 14:52:48 +01:00
operation_metadata.py fix: improve async batch retain with large payloads (#366) 2026-02-16 12:51:42 +01:00
query_analyzer.py fix(performance): improve recall and retain performance on large banks (#469) 2026-03-03 13:35:22 +01:00
response_models.py feat: include source facts in observation recall (#404) 2026-02-19 14:54:19 +01:00
task_backend.py fix: retain async fails if timestamp is set (#251) 2026-01-30 13:04:33 +01:00
utils.py feat: implement hierarchical configuration (system, tenant, bank) (#329) 2026-02-12 13:14:57 +01:00