-
Notifications
You must be signed in to change notification settings - Fork 130
feat: add native Mistral embeddings provider #169
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
feat: add native Mistral embeddings provider #169
Conversation
* 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.
nicoloboschi
left a comment
There was a problem hiding this 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 | |||
There was a problem hiding this comment.
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, |
There was a problem hiding this comment.
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
Summary
MistralEmbeddingsclass for native Mistral API supportHINDSIGHT_API_EMBEDDINGS_PROVIDER=mistralconfigurationConfiguration
Details
mistral-embedproduces 1024-dimensional embeddingsTest plan
HINDSIGHT_API_EMBEDDINGS_PROVIDER=mistral