Skip to content

Sync upstream: 5 new commits from vectorize-io/hindsight#4

Merged
franchb merged 6 commits intomainfrom
sync-upstream-main
Feb 23, 2026
Merged

Sync upstream: 5 new commits from vectorize-io/hindsight#4
franchb merged 6 commits intomainfrom
sync-upstream-main

Conversation

@franchb
Copy link
Owner

@franchb franchb commented Feb 23, 2026

Summary

  • Merge 5 new commits from upstream vectorize-io/hindsight main into this fork
  • Resolved CI workflow conflicts by keeping fork's minimal CI (deleted deploy-docs.yml and test.yml per fork policy)

Upstream changes included

Test plan

  • CI lint and unit tests pass
  • Docker build validates successfully
  • Verify no regressions in fork-specific changes (litellm DeepInfra support)

🤖 Generated with Claude Code

Summary by CodeRabbit

Release Notes

  • New Features

    • Bank configuration management: new API endpoints to get, update, and reset bank settings.
    • ZeroEntropy reranker support as an alternative reranking provider.
    • Enhanced fact extraction: metadata now included in LLM prompts for improved accuracy.
    • Mission-driven consolidation: observations now use configurable missions to guide synthesis.
    • Granular disposition control: individual skepticism, literalism, and empathy settings.
  • Deprecations

    • Bank profile endpoints marked deprecated; migrate to new config management APIs.
  • Updates

    • Updated client libraries (Python, Go, TypeScript, CLI) with new configuration options.
    • Refined reflect agent tool selection for stricter retrieval workflow.

franchb and others added 6 commits February 23, 2026 10:12
Add ZeroEntropy as a reranker provider using their Rerank API
(https://docs.zeroentropy.dev/models). Supports zerank-2 (flagship)
and zerank-2-small models via direct HTTP API calls with httpx (no
additional SDK dependency required).

Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
…al (vectorize-io#421)

* Fix reflect based_on population and enforce full hierarchical retrieval

Problem 1: based_on field was incomplete
- search_observations results were never extracted into based_on, so
  observations used by the agent were invisible to callers
- search_mental_models and get_mental_model used non-existent fields
  (summary/description) instead of the actual content field, producing
  empty text in based_on entries
- A duplicate unreachable elif block for search_mental_models was dead
  code (the first identical condition always matched)

Problem 2: mental models could produce "I don't have information"
- When a bank has mental models, the agent's tool_choice forcing only
  covered iteration 0 (search_mental_models). Iterations 1+ were auto,
  allowing the LLM to short-circuit without ever searching observations
  or raw facts. Combined with the LOW budget prompt encouraging speed,
  this meant the agent would often stop after a single tool call.
- This created a self-reinforcing failure loop: if a mental model
  refresh produced "I don't have information" (e.g. due to the agent
  skipping recall), subsequent reflects would find that content and
  trust it, never searching deeper.

Fix: extend forced tool_choice to cover the full hierarchical retrieval
path before allowing auto mode:
- With mental models: search_mental_models(0) → search_observations(1)
  → recall(2) → auto(3+)
- Without mental models: search_observations(0) → recall(1) → auto(2+)

This matches the retrieval strategy documented in the system prompt and
ensures all three knowledge levels are always consulted. The agent still
has 2-3 auto iterations (with LOW budget, max_iterations=5) for
additional searches or calling done().

* Add Umami analytics tracking to docs site

Add conditional Umami script injection to docusaurus.config.ts and pass
UMAMI_URL/UMAMI_WEBSITE_ID env vars in the GitHub Pages deploy workflow.
The tracking script only loads when both env vars are set.
# Conflicts:
#	.github/workflows/deploy-docs.yml
#	.github/workflows/test.yml
@coderabbitai
Copy link

coderabbitai bot commented Feb 23, 2026

Caution

Review failed

The pull request is closed.

ℹ️ Recent review info

Configuration used: defaults

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between baa18d6 and a025619.

⛔ Files ignored due to path filters (2)
  • hindsight-clients/typescript/generated/sdk.gen.ts is excluded by !**/generated/**
  • hindsight-clients/typescript/generated/types.gen.ts is excluded by !**/generated/**
📒 Files selected for processing (48)
  • hindsight-api/hindsight_api/api/http.py
  • hindsight-api/hindsight_api/config.py
  • hindsight-api/hindsight_api/engine/consolidation/consolidator.py
  • hindsight-api/hindsight_api/engine/consolidation/prompts.py
  • hindsight-api/hindsight_api/engine/cross_encoder.py
  • hindsight-api/hindsight_api/engine/memory_engine.py
  • hindsight-api/hindsight_api/engine/reflect/agent.py
  • hindsight-api/hindsight_api/engine/retain/fact_extraction.py
  • hindsight-api/hindsight_api/engine/search/graph_retrieval.py
  • hindsight-api/hindsight_api/engine/search/link_expansion_retrieval.py
  • hindsight-api/hindsight_api/engine/search/mpfp_retrieval.py
  • hindsight-api/hindsight_api/engine/search/retrieval.py
  • hindsight-api/hindsight_api/engine/search/types.py
  • hindsight-api/hindsight_api/main.py
  • hindsight-api/tests/test_agents_api.py
  • hindsight-api/tests/test_consolidation.py
  • hindsight-api/tests/test_custom_embedding_dimension.py
  • hindsight-api/tests/test_fact_extraction_metadata.py
  • hindsight-api/tests/test_hierarchical_config.py
  • hindsight-api/tests/test_retain.py
  • hindsight-cli/src/api.rs
  • hindsight-cli/src/commands/bank.rs
  • hindsight-clients/go/api/openapi.yaml
  • hindsight-clients/go/api_banks.go
  • hindsight-clients/go/model_create_bank_request.go
  • hindsight-clients/python/hindsight_client/hindsight_client.py
  • hindsight-clients/python/hindsight_client_api/api/banks_api.py
  • hindsight-clients/python/hindsight_client_api/models/create_bank_request.py
  • hindsight-clients/typescript/jest.config.js
  • hindsight-clients/typescript/src/index.ts
  • hindsight-control-plane/package.json
  • hindsight-control-plane/src/app/banks/[bankId]/page.tsx
  • hindsight-control-plane/src/components/bank-config-view.tsx
  • hindsight-control-plane/src/components/bank-profile-view.tsx
  • hindsight-control-plane/src/instrumentation.ts
  • hindsight-control-plane/src/lib/hindsight-client.ts
  • hindsight-docs/docs/developer/api/memory-banks.mdx
  • hindsight-docs/docs/developer/api/retain.mdx
  • hindsight-docs/docs/developer/configuration.md
  • hindsight-docs/docs/developer/observations.mdx
  • hindsight-docs/docs/developer/reflect.mdx
  • hindsight-docs/docs/developer/retain.md
  • hindsight-docs/docusaurus.config.ts
  • hindsight-docs/examples/api/memory-banks.mjs
  • hindsight-docs/examples/api/memory-banks.py
  • hindsight-docs/src/pages/faq.md
  • hindsight-docs/static/openapi.json
  • scripts/dev/start.sh

📝 Walkthrough

Walkthrough

This pull request introduces a configuration-driven bank management system, shifting from direct field updates to a centralized config-override mechanism. Key additions include ZeroEntropy reranker support, environment-driven mission/disposition settings for retain and observation operations, metadata propagation through fact extraction, and refined retrieval logic. API surface is extended while legacy endpoints are marked deprecated.

Changes

Cohort / File(s) Summary
API Request Schema & Config Structure
hindsight-api/hindsight_api/api/http.py, hindsight-api/hindsight_api/config.py, hindsight-api/hindsight_api/main.py
Restructured CreateBankRequest to use explicit config-driven fields (reflect_mission, retain_mission, disposition_skepticism/literalism/empathy, observations_mission) with get_config_updates() aggregator. Extended HindsightConfig with ZeroEntropy keys and mission/disposition fields; updated from_env() to load new settings.
Consolidation & Prompt System
hindsight-api/hindsight_api/engine/consolidation/consolidator.py, hindsight-api/hindsight_api/engine/consolidation/prompts.py
Replaced static CONSOLIDATION_SYSTEM_PROMPT and CONSOLIDATION_USER_PROMPT with config-driven build_consolidation_prompt(observations_mission). Updated _process_memory and _consolidate_with_llm signatures to accept config instead of mission string.
Reranking & Cross-Encoder
hindsight-api/hindsight_api/engine/cross_encoder.py
Introduced ZeroEntropyCrossEncoder with REST-based reranking via ZeroEntropy API; wired configuration path in create_cross_encoder_from_env() to instantiate new provider.
Memory & Config Resolution
hindsight-api/hindsight_api/engine/memory_engine.py
Added config-based precedence rules in get_bank_profile: reflect_mission overrides profile mission; disposition_skepticism/literalism/empathy overlay DB values. Adjusted expand_fn to handle used_observation_ids and use model_content instead of model_summary.
Reflect Agent Logic
hindsight-api/hindsight_api/engine/reflect/agent.py
Stricter hierarchical tool-selection flow: with mental models, enforces path (0→search_mental_models, 1→search_observations, 2→recall, 3+→auto); without mental models, allows auto at iteration 1.
Fact Extraction & Metadata
hindsight-api/hindsight_api/engine/retain/fact_extraction.py
Added retain_mission injection into extraction prompts and metadata propagation through extraction pipeline; metadata parameter threaded through _build_user_message, extract_facts_from_text, and related helpers.
Semantic Search & Retrieval
hindsight-api/hindsight_api/engine/search/{graph_retrieval,link_expansion_retrieval,mpfp_retrieval,retrieval}.py, hindsight-api/hindsight_api/engine/search/types.py
Removed embedding column from SELECT queries across all retrieval paths; removed embedding field from RetrievalResult dataclass and serialization output.
Python Client Library
hindsight-clients/python/hindsight_client/hindsight_client.py, hindsight-clients/python/hindsight_client_api/...
Extended CreateBankRequest with new fields; added get_bank_config, update_bank_config, reset_bank_config, and async variants (aget, aupdate, areset*); added deprecation warnings for legacy bank profile endpoints; deprecated set_mission and set_reflect_mission aliases.
Go Client
hindsight-clients/go/api/openapi.yaml, hindsight-clients/go/api_banks.go, hindsight-clients/go/model_create_bank_request.go
Extended CreateBankRequest schema with disposition_skepticism/literalism/empathy and retain/observations fields; marked GET/PUT /v1/default/banks/{bank_id}/profile as deprecated; added accessor/mutator methods for new fields.
TypeScript Client
hindsight-clients/typescript/src/index.ts
Added getBankConfig, updateBankConfig, resetBankConfig, and setMission helper; expanded createBank options to include reflect_mission, retain_, disposition_, enable_observations, observations_mission; added BankConfigResponse to exports.
Control Plane UI
hindsight-control-plane/src/app/banks/[bankId]/page.tsx, hindsight-control-plane/src/components/bank-{config,profile}-view.tsx
Added reset configuration dialog and UI. Refactored BankConfigView with modular per-section state (retainEdits, observationsEdits, reflectEdits) and independent save flows; added ConfigSection component with FieldRow, TextareaRow, TraitRow, Toggle subcomponents. Updated BankProfileView to accept hideReflectFields prop and switched disposition/mission save calls to updateBankConfig.
Control Plane Infrastructure
hindsight-control-plane/package.json, hindsight-control-plane/src/lib/hindsight-client.ts, hindsight-control-plane/src/instrumentation.ts
Fixed dev script port to 9999; removed console logs from hindsight-client.ts; added instrumentation.ts to log dataplane configuration at startup.
API & Configuration Tests
hindsight-api/tests/test_*.py
Added tests for consolidation prompts (default and observations_mission variants), ZeroEntropy cross-encoder, metadata inclusion in fact extraction, hierarchical config fields, and retain_mission in prompts.
CLI & Documentation
hindsight-cli/src/{api,commands/bank}.rs, hindsight-docs/docs/..., hindsight-docs/docusaurus.config.ts, hindsight-docs/examples/..., hindsight-docs/static/openapi.json
Updated CLI calls to use ..Default::default() for CreateBankRequest. Rewrote memory-banks, retain, observations, reflect, configuration docs to emphasize mission-driven configuration and new config API; added ZeroEntropy provider to reranker options; added Umami analytics conditional injection; updated API examples to demonstrate getBankConfig/updateBankConfig/resetBankConfig flows; updated openapi.json to mark deprecated endpoints and extend schemas.

Sequence Diagram(s)

sequenceDiagram
    participant Client as Client
    participant API as API Server
    participant ConfigResolver as Config Resolver
    participant MemoryEngine as Memory Engine
    participant LLM as LLM / Consolidator

    Client->>API: create_bank(bank_id, reflect_mission, retain_mission, ...)
    API->>API: CreateBankRequest.get_config_updates()
    API->>ConfigResolver: update_bank_config(bank_id, config_updates)
    ConfigResolver->>API: Store overrides
    
    Client->>API: retain(bank_id, memory_item)
    API->>MemoryEngine: extract_facts(text, config, metadata)
    MemoryEngine->>LLM: extract with retain_mission injected + metadata context
    LLM->>MemoryEngine: Return extracted facts
    MemoryEngine->>API: Store facts with metadata
    
    Client->>API: recall(bank_id, query)
    API->>MemoryEngine: retrieve_semantic_bm25_combined(query)
    MemoryEngine->>API: Return results (without embedding)
    
    Client->>API: consolidate (async)
    API->>ConfigResolver: get_config(bank_id) with precedence rules
    ConfigResolver->>API: Return config (reflect_mission, observations_mission)
    API->>LLM: consolidate with build_consolidation_prompt(observations_mission)
    LLM->>API: Return consolidated observations
Loading

Estimated code review effort

🎯 5 (Critical) | ⏱️ ~110 minutes

Poem

🐰 Hop hop, the config hops so free,
Missions guide both you and me,
Embeddings fade but logic stays,
ZeroEntropy lights new ways,
Config flows where memories play! 🌟

✨ Finishing Touches
  • 📝 Generate docstrings (stacked PR)
  • 📝 Generate docstrings (commit on current branch)
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch sync-upstream-main

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@franchb franchb merged commit 66ab0b0 into main Feb 23, 2026
5 of 6 checks passed
@franchb franchb deleted the sync-upstream-main branch February 23, 2026 20:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants