feat: multi-modal RAG
Author: xbwwjCreated Sep 23, 2026Updated Sep 23, 2026
Labelsfeat
- I have looked for existing issues (including closed) about this
Feature Request
Allow VectorStore and AgentHook to store and load non text documents.
Motivation
It's very common for an RAG to return image and other non-text content.
rig already supports ImageEmbeddingModel and non-text content in UserContent::Image.
However, image embedding is restricted on the VectorStore side.
pub trait Embed {
// only text allowed here
fn embed(&self, embedder: &mut TextEmbedder) -> Result<(), EmbedError>;
}
// text here
pub type TopNResults = Result<Vec<(f64, String, Value)>, VectorStoreError>;
pub struct RequestPatch {
// only text content allowed here.
pub extra_context: Vec<Document>,
pub history: Option<Vec<Message>>,
..
}
pub struct CompletionRequest {
// only text here
pub documents: Vec<Document>,
..
}Proposal
Most providers just turn Document into a UserContent::Text with <file id: {id}>{text}</file> or Document (another document struct, see https://github.com/0xPlaygrounds/rig/issues/2058).
So it would be easy to directly return UserContent in TopNResults.
But I have no idea how the Embed trait and derive macro should look like.
Alternatives
- tool call: the agent can provide a image search tool for model, but this is less controllable.
- with unreleased main,
AgentHookcan changeMessage, but this change is sticky
Source: 0xPlaygrounds/rig