LLM Knowledge Mistral
Turn images into searchable knowledge with Mistral AI's vision models.
Module Type: 🔌 Extension (OCR for Knowledge)
Architecture
┌───────────────────────────────────────────────────────────────┐
│ Image Sources │
│ ┌─────────────┐ ┌─────────────┐ ┌─────────────────────┐ │
│ │ Receipts │ │ Handwritten │ │ Scanned Docs │ │
│ └──────┬──────┘ └──────┬──────┘ └──────────┬──────────┘ │
└─────────┼────────────────┼────────────────────┼──────────────┘
└────────────────┼────────────────────┘
▼
┌───────────────────────────────────────────┐
│ ★ llm_knowledge_mistral (This Module) ★ │
│ Mistral OCR Parser │
│ 👁️ Vision │ 📝 Text Extract │ 🔍 Index │
└─────────────────────┬─────────────────────┘
│
┌───────────┴───────────┐
▼ ▼
┌───────────────────────────┐ ┌───────────────────────────┐
│ llm_knowledge │ │ llm_mistral │
│ (RAG Pipeline) │ │ (Mistral Provider) │
└───────────────────────────┘ └───────────────────────────┘
Installation
What to Install
For image OCR in knowledge base:
odoo-bin -d your_db -i llm_knowledge_mistral
Auto-Installed Dependencies
llm(core infrastructure)llm_knowledge(RAG infrastructure)llm_mistral(Mistral AI provider)
Why Use This Module?
| Feature | llm_knowledge_mistral |
|---|---|
| OCR | 👁️ Mistral vision models |
| Handwriting | ✍️ Handwritten text support |
| Multi-format | 📄 PDF, PNG, JPG, WEBP |
| Searchable | 🔍 Images become searchable |
Common Setups
| I want to... | Install |
|---|---|
| OCR + RAG | llm_knowledge_mistral + llm_pgvector |
| Chat + OCR + RAG | llm_assistant + llm_openai + llm_knowledge_mistral + llm_pgvector |
Extract text from handwritten notes, receipts, scanned documents, screenshots, and product labels. Make every image searchable in your knowledge base with automatic OCR processing.
Overview
This module extends llm_knowledge with Mistral AI's vision capabilities, enabling OCR (Optical Character Recognition) for images and scanned documents. Upload an image, and Mistral's vision models extract all text content, making it fully searchable through your AI assistant.
The Problem
Without OCR:
- Images are just binary blobs in your knowledge base
- Handwritten notes can't be searched
- Scanned documents are dead weight
- Receipts and invoices are unusable
- Knowledge stays locked in images
The Solution
With Mistral OCR:
- AI extracts text from any image
- Handwriting becomes searchable
- Scanned docs fully indexed
- Receipt data automatically parsed
- Everything is findable
Features
Mistral Vision OCR
- State-of-the-art accuracy: Powered by Mistral's multimodal vision models
- Handwriting recognition: Extracts text from handwritten notes and forms
- Multi-format support: Images (PNG, JPG, WEBP), PDFs, scanned documents
- Automatic extraction: No manual data entry required
OCR Models
Three Mistral OCR models included:
- mistral-ocr-latest: Latest OCR model (recommended)
- mistral-ocr-2505: Specific version from May 2025
- mistral-ocr-2503: Specific version from March 2025
Mistral OCR Parser
- Seamless integration with llm_knowledge processing pipeline
- Automatic text extraction from image attachments
- Preserves original images while extracting text content
- Works with existing chunking and embedding systems
Installation
-
Install dependencies:
llm_knowledgemodule (required)llm_mistralmodule (required)
-
Install this module:
# Via Odoo Apps interface Apps → Search "LLM Knowledge Mistral" → Install -
Set up Mistral provider:
- Go to LLM → Configuration → Providers
- Configure your Mistral AI provider with API key
- Click "Fetch Models" to download available OCR models from Mistral
- This populates the OCR models list automatically
Configuration
Step 1: View OCR Models
The module comes pre-configured with Mistral's OCR models. View them under LLM → Configuration → Models, filtered by "ocr".
Available models:
mistral-ocr-latest- Latest OCR model (recommended)mistral-ocr-2505- May 2025 versionmistral-ocr-2503- March 2025 version
Step 2: Configure Parser
When creating or editing a knowledge resource:
- Select "Mistral OCR Parser" from the Parser dropdown
- Choose your preferred OCR model (mistral-ocr-latest recommended)
- Upload images as attachments
- Click "Process Resources"
Parser settings:
- Parser: Mistral OCR Parser
- Provider: Mistral AI (auto-selected)
- OCR Model: mistral-ocr-latest or specific version
- Supported formats: PNG, JPG, WEBP, PDF
Step 3: Process and Search
Click "Process Resources" to extract text from your images. The extracted text becomes searchable through your AI assistant.
Usage Examples
Handwritten Grocery List
Input: Photo of handwritten grocery list
Output: Extracted text
- potatoes
- peas & carrots
- pastina
- garbage bags
- dog treats
- aluminum foil
- almond milk
- creamer - vanilla
- eggs (2)
- crushed tomatoes
- hot sauce
- paper towels?
Result: Fully searchable in knowledge base. Ask "What items are on the grocery list?" and AI finds and lists all items.
Expense Management
Goal: Track business expenses from receipt photos
Setup:
- Upload receipt photos to knowledge collection
- Use Mistral OCR Parser
- Process resources
Result: Extract vendor, amount, date, and items from receipts. Search "Find all Starbucks receipts from last month" → AI finds all matching receipts and totals.
Meeting Notes Archive
Goal: Make handwritten meeting notes searchable
Setup:
- Scan or photograph handwritten meeting notes
- Upload to knowledge base
- Process with Mistral OCR
Result: Every decision, action item, and idea becomes searchable. Ask "What did we decide about the Q4 budget?" → AI cites exact meeting notes.
Product Label Extraction
Goal: Index product information from label photos
Setup:
- Photograph product labels
- Add to product knowledge collection
- Process with Mistral OCR
Result: Extract ingredients, nutritional info, warnings, and instructions. AI can answer product questions using label data.
How It Works
Processing Pipeline
When you process an image resource with Mistral OCR:
- Upload: Attach image to llm.resource
- Parse: Mistral OCR Parser sends image to Mistral AI vision model
- Extract: Vision model analyzes image and extracts all text
- Save: Extracted text saved to resource's content field
- Chunk: Text chunked using collection's chunker settings
- Embed: Chunks embedded and stored in vector database
- Search: AI can now search and cite this content in responses
Supported Image Types
- Handwritten text: Notes, forms, letters
- Printed text: Documents, books, manuals
- Receipts: Business expenses, invoices
- Screenshots: Error messages, UI text
- Product labels: Ingredients, instructions
- Whiteboards: Brainstorming sessions, diagrams
- Forms: Filled-out applications, surveys
- Scanned documents: PDFs, legacy files
Technical Details
Mistral OCR Models
The available OCR models are fetched from Mistral AI when you configure the provider:
| Model | Description | Recommended |
|---|---|---|
mistral-ocr-latest |
Latest OCR model | ✓ Yes |
mistral-ocr-2505 |
May 2025 version | - |
mistral-ocr-2503 |
March 2025 version | - |
Note: You must set up the Mistral provider via llm_mistral module and click "Fetch Models" to download the available OCR models from Mistral AI.
Parser Configuration
The Mistral OCR Parser is registered in models/mistral_resource_parser.py on the llm.resource model:
@api.model
def _get_available_parsers(self):
parsers = super()._get_available_parsers()
parsers.extend([
("mistral_ocr", "Mistral OCR Parser"),
])
return parsers
API Usage
Process image programmatically:
# Get resource with image attachment
resource = env['llm.resource'].browse(resource_id)
# Get Mistral provider
mistral_provider = env['llm.provider'].search([('service', '=', 'mistral')], limit=1)
# Get OCR model
ocr_model = env['llm.model'].search([
('name', '=', 'mistral-ocr-latest'),
('model_use', '=', 'ocr')
], limit=1)
# Configure resource
resource.write({
'parser': 'mistral_ocr',
'llm_provider_id': mistral_provider.id,
'llm_model_id': ocr_model.id,
})
# Process to extract text
resource.process_resource()
# Access extracted text
print(resource.content)
Fields Added to llm.resource
This module extends llm.resource with:
- llm_model_id: Many2one to OCR model (domain:
model_use = 'ocr') - llm_provider_id: Many2one to Mistral provider (domain:
service = 'mistral') - parser: Selection field with "mistral_ocr" option
Troubleshooting
OCR not extracting text
- Verify image quality is sufficient (not too blurry)
- Check Mistral API credentials are configured
- Review system logs for API errors
- Try different OCR model version
Handwriting not recognized
- Ensure handwriting is legible
- Use high-resolution images
- Try mistral-ocr-latest (best for handwriting)
- Avoid low-light or skewed photos
Wrong text extracted
- Check image orientation (rotate if needed)
- Verify image is not corrupted
- Ensure sufficient contrast between text and background
- Try cropping to focus on text area
Best Practices
- Image quality: Use high-resolution images (at least 1024px width)
- Lighting: Ensure good lighting and contrast
- Orientation: Rotate images to correct orientation before upload
- File format: Use PNG or JPG for best results
- File size: Keep images under 10MB for faster processing
- Batch processing: Process multiple images at once for efficiency
Requirements
- Odoo: 18.0+
- Python: 3.11+
- Dependencies:
llm_knowledgemodulellm_mistralmodule
- API: Mistral AI API key required
License
LGPL-3
Author
Apexive Solutions LLC
- Website: https://github.com/apexive/odoo-llm
- Email: info@apexive.com
Contributing
Issues and pull requests welcome at https://github.com/apexive/odoo-llm


