Skip to content

feat(multimodal): cross-modal types + trait seams (closes #146, #148, #153, #156)#185

Merged
stevei101 merged 3 commits into
developfrom
feat/multimodal-foundation
Jun 4, 2026
Merged

feat(multimodal): cross-modal types + trait seams (closes #146, #148, #153, #156)#185
stevei101 merged 3 commits into
developfrom
feat/multimodal-foundation

Conversation

@stevei101
Copy link
Copy Markdown
Contributor

Summary

What's in the box

File Contents Closes
multimodal/types.rs ContentType, MultimodalContent, ContentSource #153 (types portion)
multimodal/embedding.rs Embedding, EmbeddingMetadata, ModelInfo, EmbeddingEngine, EmbeddingError #146
multimodal/store.rs SearchFilters, SearchResult, VectorStore, VectorStoreError #148
multimodal/ingest.rs MultimodalIngestor, IngestError #153 (trait portion)
multimodal/search.rs CrossModalSearcher, SearchError #156

Design notes

  • Additive, not replacement. The text-only EmbeddingProvider lives on; callers that only need text don't have to migrate.
  • Embedding::vector is Vec<f32> (not const-generic). Backends report dim via ModelInfo::dimensions; callers validate at insert time.
  • VectorStore::search_by_type and store_batch have default impls so future backends can override progressively.
  • IngestError::UnsupportedMime field renamed sourceorigin to avoid thiserror's implicit #[source] convention.
  • ContentSource::DirectContent.databytes per workspace clippy disallowed_names rule (AGENTS.md).

Test plan

  • cargo test -p graphrag-core --features multimodal --lib375/375 pass (12 new multimodal tests + 363 pre-existing)
  • cargo test -p graphrag-core --features multimodal --doc multimodal:: — 2/2 doctests pass
  • cargo clippy -p graphrag-core --features multimodal --all-targets -- -D warnings clean
  • cargo clippy -p graphrag-core --all-targets -- -D warnings clean (default features still build)
  • CI green on PR

Refs

🤖 Generated with Claude Code

, #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>
aivcs 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.
@stevei101 stevei101 merged commit 254b942 into develop Jun 4, 2026
1 check failed
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.

Define EmbeddingEngine Trait & Embedding Type

2 participants