feat(multimodal): cross-modal types + trait seams (closes #146, #148, #153, #156)#185
Merged
Conversation
, #156) Introduces the multimodal RAG foundation under a new `multimodal` feature flag in graphrag-core. Types + async traits only; no backend impls yet — those land in follow-on PRs per meta-epic #182. Module layout (`graphrag-core/src/multimodal/`): - `types` — `ContentType`, `MultimodalContent`, `ContentSource` - `embedding` — `Embedding`, `EmbeddingMetadata`, `ModelInfo`, `EmbeddingEngine` trait, `EmbeddingError` - `store` — `SearchFilters`, `SearchResult`, `VectorStore` trait, `VectorStoreError` - `ingest` — `MultimodalIngestor` trait, `IngestError` - `search` — `CrossModalSearcher` trait, `SearchError` Closes #146, #148, #153, #156. Lays groundwork for #147, #149, #150, #151, #152, #154, #155, #157, #158, #159. Design notes: - Additive to the existing text-only `EmbeddingProvider` — text-only callers stay where they are. - `Embedding::vector` is `Vec<f32>` (not a const-generic length); backends report dimensionality via `ModelInfo`, callers validate per-store. - `VectorStore::search_by_type` and `_batch` methods ship with default impls so backends can override progressively. - `IngestError::UnsupportedMime` field renamed `source` → `origin` to avoid thiserror's implicit `#[source]` convention. - `ContentSource::DirectContent.data` → `bytes` to satisfy the workspace clippy `disallowed_names` rule (per AGENTS.md). - Each public type carries a doctest or unit test; `multimodal::*` tests: 12 lib + 2 doctests, all green. Refs meta-epic #182, TDD `docs/tdd-multimodal-and-service.md` phase 2.1. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
5 tasks
added 2 commits
June 4, 2026 15:48
Stable rustfmt fails on unstable options like 'error_on_line_overflow'. This fix allows the 'fmt' check to pass in the stable Nix toolchain while preserving the intended configuration for future nightly migrations.
Since unstable rustfmt options were disabled, the code is now formatted using stable rules to pass CI.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
multimodalfeature flag ingraphrag-coregating a freshgraphrag-core/src/multimodal/module.What's in the box
multimodal/types.rsContentType,MultimodalContent,ContentSourcemultimodal/embedding.rsEmbedding,EmbeddingMetadata,ModelInfo,EmbeddingEngine,EmbeddingErrormultimodal/store.rsSearchFilters,SearchResult,VectorStore,VectorStoreErrormultimodal/ingest.rsMultimodalIngestor,IngestErrormultimodal/search.rsCrossModalSearcher,SearchErrorDesign notes
EmbeddingProviderlives on; callers that only need text don't have to migrate.Embedding::vectorisVec<f32>(not const-generic). Backends report dim viaModelInfo::dimensions; callers validate at insert time.VectorStore::search_by_typeandstore_batchhave default impls so future backends can override progressively.IngestError::UnsupportedMimefield renamedsource→originto avoid thiserror's implicit#[source]convention.ContentSource::DirectContent.data→bytesper workspace clippydisallowed_namesrule (AGENTS.md).Test plan
cargo test -p graphrag-core --features multimodal --lib— 375/375 pass (12 new multimodal tests + 363 pre-existing)cargo test -p graphrag-core --features multimodal --doc multimodal::— 2/2 doctests passcargo clippy -p graphrag-core --features multimodal --all-targets -- -D warningscleancargo clippy -p graphrag-core --all-targets -- -D warningsclean (default features still build)Refs
docs/tdd-multimodal-and-service.md🤖 Generated with Claude Code