Skip to content

feat(retrieval): add LLM query expansion with multi-query fusion#159

Closed
Salomondiei08 wants to merge 580 commits into
EverMind-AI:mainfrom
Salomondiei08:feature/query-expansion
Closed

feat(retrieval): add LLM query expansion with multi-query fusion#159
Salomondiei08 wants to merge 580 commits into
EverMind-AI:mainfrom
Salomondiei08:feature/query-expansion

Conversation

@Salomondiei08
Copy link
Copy Markdown

Checklist

  • My code follows the project's code style guidelines
  • I have performed a self-review of my code
  • I have commented my code where necessary, particularly in complex areas
  • I have updated the documentation accordingly
  • My changes generate no new warnings or errors
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes
  • I have used Gitmoji in my commit messages
  • Any dependent changes have been merged and published

Additional Notes

  • _search_hybrid is unchanged and still used by the AGENTIC and RRF retrieval paths — only the HYBRID path is affected
  • Query expansion adds one LLM call per retrieval request (~200ms overhead). The fallback ensures zero regression if the LLM is unavailable
  • Recall improvement is measurable via Recall@K with single-query vs expanded-query baselines
  • Expansion temperature is set to 0.6 to encourage vocabulary diversity across variants

Breaking Changes

None. _search_hybrid is preserved as-is. The new routing in retrieve_mem_hybrid is fully backward compatible and falls back to the original behavior on any failure.

hui zhang and others added 30 commits December 10, 2025 12:04
feat:support eventlog/foresight in keyword/vector/hybird search mode for v1-api

See merge request npc-work/aic/ai/evermemos-opensource!52
Resolved conflicts:
- demo/extract_memory.py: Keep V3 API config and prompt_clear_data function
- Updated type imports: Memory -> BaseMemory, ForesightItem -> Foresight
- Kept PromptManager architecture with get_prompt_by()
- Used absolute imports per project standards

Risk check passed: all imports, prompts, and extractor compatibility verified.
feat: Optimize demo and related memory chat logic

See merge request npc-work/aic/ai/evermemos-opensource!40
:global_with_meridians: utc

:global_with_meridians: utc

:global_with_meridians: utc
:global_with_meridians: utc

See merge request npc-work/aic/ai/evermemos-opensource!55
refactor:v1 api search, support rrf and agentic search, update readme

See merge request npc-work/aic/ai/evermemos-opensource!53
Feature/boundary opt

See merge request npc-work/aic/ai/evermemos-opensource!54
cyfyifanchen and others added 28 commits February 11, 2026 01:10
- Remove duplicate summary_text assignment in conv_memcell_extractor.py
- Remove redundant cluster state file exports in stage1_memcells_extraction.py since cluster_storage.save_cluster_state already handles saving both cluster_state and cluster_map internally

Co-authored-by: root <root@nlu-guishangtong-sbajo4-0.nlu-guishangtong-sbajo4.lizr-a.svc.dev00-bcebj.local>
Co-authored-by: Claude <noreply@anthropic.com>
* refactor: normalize request converter parsing

* refactor: dedupe request param parsing in memory controller

* refactor: harden lightweight retrieval similarity handling

* fix: close agentic services during business shutdown
* docs: update README with community links and branding

* docs: update community links and badge labels
* docs: update README with new competition banner and examples

* docs: update light mode divider image asset link

* docs: update README with corrected spelling and added links

* docs: update README with competition and example links

* docs: remove commented section and fix light mode divider

* docs: remove divider images from README
…Mind-AI#116)

Update the OpenClaw Long-Term Memory Plugin section to reflect its release status by removing "coming this week" label. Also fix the markdown image link syntax to properly wrap the image in a link to the agent_memory branch.
…#119)

Update the link for the use case image and add reference to the EverMind + OpenClaw plugin repository. The change clarifies the project structure and provides direct access to the plugin code.
* docs: update README with corrected links and plugin info

Update the link for the use case image and add reference to the EverMind + OpenClaw plugin repository. The change clarifies the project structure and provides direct access to the plugin code.

* docs: update usecases image link to point to agent_memory branch
- Introduced the EverOS OpenClaw Plugin, enabling full-lifecycle memory management for OpenClaw through the EverOS backend.
- Added core files including index.js for plugin registration, openclaw.plugin.json for metadata, and README documentation.
- Implemented installation script for easy setup and configuration.
- Included support for memory retrieval and storage via the EverMemOS API.
- Added Chinese translation of the README for broader accessibility.
…Plugin

- Updated the searchMemories function to consolidate search requests and handle profile fetching more efficiently.
- Removed unsupported memory types from configuration and adjusted memory type handling in search logic.
- Enhanced message processing by stripping channel metadata and including pending messages in responses.
- Improved parsing of search responses to accommodate new profile data structures and pending messages.
* chore: rename project from EverMemOS to EverOS

Update all references to the project name, including:
- NOTICE and project metadata files
- Documentation and README files
- Code comments and docstrings
- Configuration files and system names
- Example data and demo references
- Adapter directories and imports
- Docker container names and labels
- Security report subject line
- Plugin descriptions and metadata

This rebranding consolidates the project under the EverOS name while maintaining full compatibility.

* docs: update README.zh.md with new project focus and structure

Update the Chinese README to reflect the project's current focus on Memory Sparse Attention (MSA) instead of the Memory Genesis Competition.
- Replace competition announcement with MSA paper and technical highlights.
- Simplify and update the table of contents.
- Reorder and comment out old badge sections.
- Update banner image and arXiv badge link.
- General cleanup and formatting improvements.
)

Update all references in the documentation to reflect the new project name.
This includes headings, links, descriptions, and image captions to ensure
consistency across the
Addresses vocabulary mismatch failure mode in hybrid retrieval where stored
memories use different terms than the query (e.g. 'rescue inhaler protocol'
stored vs 'gym bag' queried).

Changes:
- src/memory_layer/query_expansion.py: new module implementing expand_query()
  which generates 2-3 LLM paraphrase variants of a query using a structured
  prompt. Falls back silently (returns []) on any LLM failure.
  Also provides merge_hits_by_id() for union-dedup of per-query result sets.

- src/agentic_layer/memory_manager.py: retrieve_mem_hybrid() now routes
  through _search_hybrid_with_query_expansion() instead of _search_hybrid().
  This runs keyword+vector search in parallel for the original query and each
  variant, merges results by memory id (original-query scores preserved),
  then reranks the union against the original query for consistent scoring.
  Falls back to plain hybrid search when expansion produces no variants.

Inspired by RAG-Fusion / HyDE. Recall improvement is measurable via
Recall@K with single-query vs expanded-query baselines.
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.