Skip to content

feat: add single-rag and multi-rag hybrid retrieval with exact citations #2443

Open

Description

@Zxf-xufeng

Feature description

Provide full-text/vector hybrid retrieval over explicitly selected rag Artifacts in the same Scope or across authorized Scopes, with exact document and original-input citations.

Implementation scope

  • Accept complete rag references. A Scope identifier alone must not silently select the first knowledge base or all knowledge bases in that Scope.
  • Apply Scope, rag membership, metadata, lifecycle, and published-revision filters within each retrieval channel.
  • Implement hybrid fusion, bounded candidates, provenance-preserving deduplication, and cross-rag rank fusion.
  • Generate query embeddings for each active profile as needed. Do not mix incompatible vectors or compare raw scores across incompatible indexes.
  • Return Scope/rag identity, exact document revision, chunk, SourceRef, and effective index profile/generation metadata.
  • Provide authorized passage reads and OCR original-image references, with genuine regions where supported or explicit whole-image references otherwise.
  • Report per-target execution and partial failures, distinguishing no matches from unavailable indexes, timeouts, and missing capabilities.
  • Deliver HTTP APIs, Python client methods, necessary MCP tools, and explicit knowledge-base context assembly while preserving existing Memory retrieval defaults.
  • Define retrieval strategy and optional reranking extension points with bounded execution budgets.

Acceptance criteria

  • Selecting K1 does not retrieve K2 unless K2 is explicitly selected, even when both share a Scope.
  • Same-Scope and cross-Scope multi-rag queries work with explicit target selection.
  • Queries respect active embedding profiles and use deterministic rank fusion rather than incompatible raw-score comparison.
  • Markdown and OCR results resolve to exact content revisions and original evidence.
  • Every target is authorized; parent relationships and context references do not implicitly grant access.
  • Failed targets are explicit and are not reported as no matches; failure of every target returns a failure.
  • Caches and passage reads respect current permissions and lifecycle visibility.
  • Observable retrieval and citation behavior is validated on SQLite, SeekDB, and OceanBase.

Dependencies and boundaries

Parent tracking issue: #2440. Depends on #2441 and #2442.

Design: Scheme B RFC.

Phase one uses Scope-level authorization. Multiple rag Artifacts in one Scope are content/configuration groups, not independent confidentiality boundaries.

Production reranking, agentic retrieval, and federation across independently deployed services are deferred. Establish their extension boundaries without introducing a general Agent orchestration framework.

Activity

  1. changed the title [-]feat: add knowledge-base hybrid retrieval and extensible search strategies[/-] [+]feat: add single-rag and multi-rag hybrid retrieval with exact citations[/+] on Nov 9, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions