Repository navigation
feat: add visual-document multimodal RAG - #1049
Merged
AmitoVrito merged 13 commits intoSep 21, 2026
Merged
Conversation
supports_multimodal defaults to False on BaseLLM, so most providers now silently skip captioning for ImageLoader instead of erroring or captioning. Surface it via a log so the degradation isn't invisible. Co-authored-by: Dhruv Garg <[email protected]>
retrieve_with_scores ran the MaxSim numpy matmuls directly on the event loop, blocking it for the full scan duration on large page corpora and violating the framework's async-first invariant. Co-authored-by: Dhruv Garg <[email protected]>
… silently matching nothing _filter_candidates caught TypeError from an unhashable filter value (e.g. a bbox list) and returned [] for the whole query, indistinguishable from a real empty result. Unhashable metadata is never indexed by _update_index, so querying on it can never match anything -- fail fast instead. Co-authored-by: Dhruv Garg <[email protected]>
…l RAG tests Project testing standard forbids MagicMock/Mock/mocker.patch anywhere; this new test file used them for pipeline stubs and PDFLoader.aload interception. Replace with hand-written recorder/fake classes and pytest's monkeypatch (real attribute substitution, not a Mock object). Co-authored-by: Dhruv Garg <[email protected]>
…nothing _ask_visual/_stream_visual always built the vision-flavored prompt once page_count > 0, even for queries where the visual retriever returns no results. Fall back to the plain text pipeline in that case instead of framing the answer around nonexistent visual evidence. Co-authored-by: Dhruv Garg <[email protected]>
add_async swallowed all render_file exceptions (corrupted/password-protected PDF, missing renderer) with a bare except and no logging, so callers saw "success" with silently zero visual indexing. Log a warning so the degradation is visible. Co-authored-by: Dhruv Garg <[email protected]>
…it through _prepare_image silently returned the original wrapper object (not bytes/str) when base64 image data was empty, which then hit the processor/model call and crashed opaquely deep inside transformers/PIL. Raise a clear ValueError at the boundary instead. Co-authored-by: Dhruv Garg <[email protected]>
…lently passing them through _validate_batch guarded divide-by-zero for zero-norm token rows but left them unnormalized with no signal. A genuine all-zero (e.g. padding-heavy) token vector now silently participates in MaxSim scoring. Warn when this happens so it's visible instead of silently biasing retrieval scores. Co-authored-by: Dhruv Garg <[email protected]>
Resolve conflicts in ci.yml (keep both visual-rag-gate and orchestration-eval-gate jobs), README.md (fold visual-page retrieval into main's refreshed table format), and uv.lock (regenerated). Add the missing Unreleased CHANGELOG entry for SynapseKit#894 at merge time, including the post-review fixes.
Collaborator
|
Thanks for this one @DhruvGarg111 , visual RAG is a big feature and the ColPali/ColQwen integration is really solid work. Merged into main, closes #894. Made a handful of small fixes on top before merging (mostly around silent failure modes and the async gate) but the core design held up well. Appreciate the effort here. |
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
RAGwith additiveMultimodalRAG, deterministic page/bbox/source citations, and text fallback.Motivation
Scanned PDFs and slide decks often contain meaning in layout, charts, colors, and images that text-only retrieval cannot recover.
Closes #894
Changes
ColPaliEmbeddingsandColQwenEmbeddingsadapters.VisualPage, image/PDF/PPTX renderers, SVG dispatch, table fallback extraction, and consistent page/slide provenance.visualoptional dependency group and updates the lockfile.ImagePageRendererbefore retrieval.Test Plan
1221 passed, 43 skipped2 passeduv lock --checkuv buildNotes for Reviewers
tests/agents/test_tools.py::TestPythonREPLTool::test_timeout_on_slow_operation(423 passed, 27 skipped, 1 failedwith--maxfail=1).