Skip to content

Add Mistral Document AI for document parsing#175

Draft
r-dh wants to merge 6 commits intomainfrom
rd-mistral-ocr
Draft

Add Mistral Document AI for document parsing#175
r-dh wants to merge 6 commits intomainfrom
rd-mistral-ocr

Conversation

@r-dh
Copy link
Contributor

@r-dh r-dh commented Jan 23, 2026

This PR is work in progress, and not to be merged as is.

Implementing Mistral requires a lot of architectural decisions, which I want to make explicit and I want to invite discourse.

  1. document_processor: MistralOCRConfig | None is concrete if a second processor (Azure Document Intelligence) is added later, this becomes a growing union type and the dispatcher becomes an if/elif chain. A Protocol with a process(doc_path) -> str method would be more extensible. I decided it is acceptable for now with one implementation, but this could rack up tech debt if not properly addressed later.

  2. I'm currently discarding the image data entirely. Users get text descriptions but lose the ability to embed or reference original images. I think it makes sense as a default for RAG since we only process text, but it's a silent, non-configurable choice now.

  3. Right now, Batch Inference is not implemented. This could greatly reduce costs for large projects. Also, no retry logic on the API call has been added.

Additionally, the tests for Mistral are currently weak and need to be improved before this can be merged.

@emilradix emilradix marked this pull request as draft January 26, 2026 15:31
@emilradix
Copy link
Collaborator

@r-dh I marked this as draft, as I understood from your description it is not ready yet to be merged.

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.

2 participants