Skip to content

Conversation

@ninosclaude
Copy link

Summary

  • Add MistralEmbeddings class for native Mistral API support
  • Enables HINDSIGHT_API_EMBEDDINGS_PROVIDER=mistral configuration
  • Uses Mistral's OpenAI-compatible API with dedicated endpoint

Configuration

HINDSIGHT_API_EMBEDDINGS_PROVIDER=mistral
HINDSIGHT_API_EMBEDDINGS_MISTRAL_API_KEY=your-key  # or falls back to LLM_API_KEY
HINDSIGHT_API_EMBEDDINGS_MISTRAL_MODEL=mistral-embed  # default

Details

  • mistral-embed produces 1024-dimensional embeddings
  • Enables 100% Mistral (LLM + embeddings) for EU-compliant deployments
  • No more workaround needed with OpenAI provider + Mistral base_url

Test plan

  • Test with HINDSIGHT_API_EMBEDDINGS_PROVIDER=mistral
  • Verify 1024-dim embeddings are generated
  • Test OpenAI provider still works for staging

nicoloboschi and others added 13 commits January 12, 2026 20:58
* fix: entities list only show 100 entities

* fix: update Rust CLI for entities pagination API changes
* fix: improve mpfp retrieval

* fix: improve mpfp retrieval

* fix: improve embeddings service performances

* fix: improve embeddings service performances

* fix: improve embeddings service performances

* fix: improve embeddings service performances
Mistral API doesn't support max_completion_tokens parameter (HTTP 422).
Detect Mistral models by model name or base_url and use max_tokens instead.

This enables running Hindsight with 100% Mistral (LLM + embeddings via TEI)
for EU-compliant deployments without OpenAI dependency.
feat: Mistral API support + upstream fixes
Change default bank name from bank_id to "User" to prevent
user_id from leaking into opinion entities via the agent_name
flow through fact extraction.

Root cause: bank_id (which is user_id) was used as default name,
then agent_name = profile["name"], then LLM prompt included
"Your name: {agent_name}" which extracted as "who" entity.

Fix: Use static "User" as default name instead.
…eval (#2)

* feat(reflect): add search_context parameter for enhanced memory retrieval

Problem: reflect() only searched memories using the query parameter, ignoring
the context. Abstract queries like "Was that a good solution?" found no
relevant memories even when context="Auth bug fix" was provided.

Solution: Add search_context parameter that enhances the recall query:
- If search_context is provided, use it to augment the search
- If not provided, fall back to using context for search (new default behavior)
- Set search_context="" to explicitly disable context-based search enhancement

This is backwards compatible - existing code works better automatically.

Changes:
- memory_engine.py: Add search_context param, build enhanced search query
- http.py: Add search_context to ReflectRequest model and API endpoint
- mcp.py: Add search_context to MCP tool
- interface.py: Update abstract method signature

* fix: truncate auto-added context to 256 chars for search

Addresses Gemini review feedback about potential embedding token limit issues
when context is large. Explicit search_context is not truncated.

---------

Co-authored-by: Nino Wagensonner <[email protected]>
Major upstream features:
- Agentic reflect with tools (lookup, recall, learn, expand)
- Mental models for synthesized knowledge
- Tags for memory organization
- Various bug fixes and improvements

Note: search_context feature from PR #2 needs to be re-implemented
for the new agentic reflect architecture.
Merge artifacts caused ITEMS_PER_PAGE and handlePageChange to be defined twice.
GitHub runners run out of space during large Docker builds.
Remove unused packages (dotnet, android, ghc, codeql) to free ~30GB.
Add MistralEmbeddings class that uses Mistral's OpenAI-compatible API
with the dedicated https://api.mistral.ai/v1 endpoint.

Configuration:
- HINDSIGHT_API_EMBEDDINGS_PROVIDER=mistral
- HINDSIGHT_API_EMBEDDINGS_MISTRAL_API_KEY (or falls back to LLM_API_KEY)
- HINDSIGHT_API_EMBEDDINGS_MISTRAL_MODEL (default: mistral-embed)

The mistral-embed model produces 1024-dimensional embeddings.

This enables running Hindsight with 100% Mistral (LLM + embeddings)
for EU-compliant deployments.
Copy link
Collaborator

@nicoloboschi nicoloboschi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the PR

Why do we need native support if it's already easily configurable via openai embeddings?

My suggestion would be to just update the documentation to explain how to

@@ -0,0 +1,65 @@
name: Build and Push Docker Image
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you remove this file?

query=query,
budget=budget_enum,
context=context,
search_context=search_context,
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is unrelated to the pr

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