---
agent:
  instructions: "Use this search API to find relevant content across this site with keywords or natural-language queries, instead of crawling individual pages. Results are returned in Markdown."
  endpoint: "https://mixpeek.com/.well-known/search?q={query}"
  method: GET
  documentation: "https://mixpeek.com/llms.txt"
---

1.  [](/)
2.  [Code examples](/recipes)
3.  Document Intelligence Search

Back to code examples

Similar

# Document Intelligence Search

Extract and search through PDFs, presentations, and documents. Combines OCR, layout analysis, and semantic search for comprehensive document retrieval.

text

image

Multi-Tier

[Run in Builder](/build?recipe=document-search-pipeline)

Python

cURL

from mixpeek import Mixpeek

client \= Mixpeek(api\_key\="YOUR\_API\_KEY", namespace\="doc-search")

\# 1. A bucket for the PDFs, and a collection that splits pages into layout blocks with OCR, confidence and an E5 embedding each

bucket \= client.buckets.create(

    bucket\_name\="contracts",

    bucket\_schema\={

        "properties": {

            "contract": {

                "type": "pdf",

            },

        },

    },

)

collection \= client.collections.create(

    collection\_name\="contracts",

    source\={"type": "bucket", "bucket\_ids": \[bucket\["bucket\_id"\]\]},

    feature\_extractor\={

        "feature\_extractor\_name": "document\_graph\_extractor",

        "version": "v1",

    },

)

\# 2. Upload and process

client.buckets.upload(

    bucket\["bucket\_id"\],

    blobs\=\[{"property": "contract", "type": "pdf", "data": "s3://your-bucket/contracts/msa-acme.pdf"}\],

)

client.collections.trigger(collection\["collection\_id"\])

\# 3. Dense and BM25 search over block text fused with RRF, then a cross-encoder rerank (BM25 reads the namespace text payload indexes)

retriever \= client.retrievers.create(

    retriever\_name\="contract-search",

    collection\_identifiers\=\["contracts"\],

    input\_schema\={

        "query": {

            "type": "text",

            "required": True,

        },

    },

    stages\=\[

        {

            "stage\_name": "search",

            "stage\_id": "feature\_search",

            "parameters": {

                "searches": \[

                    {

                        "feature\_uri": "mixpeek://document\_graph\_extractor@v1/intfloat\_\_multilingual\_e5\_large\_instruct",

                        "query": {

                            "input\_mode": "text",

                            "value": "{{INPUT.query}}",

                        },

                        "top\_k": 50,

                    },

                    {

                        "feature\_uri": "mixpeek://document\_graph\_extractor@v1/intfloat\_\_multilingual\_e5\_large\_instruct",

                        "query": {

                            "input\_mode": "text",

                            "value": "{{INPUT.query}}",

                        },

                        "top\_k": 50,

                        "lexical": True,

                    },

                \],

                "fusion": "rrf",

                "final\_top\_k": 50,

            },

        },

        {

            "stage\_name": "rerank",

            "stage\_id": "rerank",

            "parameters": {

                "inference\_name": "BAAI\_\_bge\_reranker\_v2\_m3",

                "query": "{{INPUT.query}}",

                "document\_field": "text\_raw",

                "top\_k": 10,

            },

        },

    \],

)

\# 4. Search

results \= client.retrievers.execute(

    retriever\["retriever\_id"\],

    inputs\={

    "query": "indemnification clause with liability cap",

},

)

for doc in results\["documents"\]:

    print(doc\["page\_number"\], doc\["text\_raw"\]\[:80\], doc\["score"\])

### Feature Extractors

Document Graph Extractor

Decompose PDFs into spatial blocks (paragraphs, tables, forms, headers) with layout classification and E5 text embeddings.

### Retriever Stages

feature search

Search and filter documents by vector similarity using feature embeddings

filter

rerank

Rerank documents using cross-encoder models for accurate relevance

sort

## Frequently asked questions

### Does it handle scanned PDFs?

Yes. The OCR extractor processes scanned documents and handwritten text, converting them to searchable content.

### Can I search within tables and charts?

Yes. The PDF extraction pipeline identifies tables, charts, and figures, extracting their content for search indexing.

### What about multi-language documents?

The OCR and embedding models support 100+ languages. Documents in any supported language are automatically processed.

## Use Cases Using This Recipe

Intermediate

### Insurance Claims Document Processing

Extract structured data from claims documents, photos, and correspondence automatically

70% reduction in manual document handling

Adjuster data entry time

insurance

Who It's For

Insurance carriers, claims adjusters, and third-party administrators processing 1,000+ claims monthly across property, casualty, auto, and health lines

[View Details](/use-cases/insurance-claims-document-processing)

Beginner

### Semantic Search for Knowledge Bases

Find answers by meaning, not keywords, across your entire knowledge repository

85% of queries answered on first search vs. 40% baseline

First-search success rate

[

education

](/solutions/education)

Who It's For

Knowledge management teams, internal documentation owners, customer support organizations, and EdTech platforms maintaining 10K+ articles, documents, and multimedia resources

[View Details](/use-cases/semantic-search-knowledge-base)

Intermediate

### Enterprise RAG Search

Ask questions across all your enterprise data and get sourced, verifiable answers

80% faster from question to answer

Information retrieval time

[

finance

](/solutions/finance)

Who It's For

Financial services firms, consulting organizations, legal teams, and enterprise knowledge workers who need to synthesize information across thousands of internal documents, reports, and presentations

[View Details](/use-cases/enterprise-rag-search)

Advanced

12 min

### Clinical NLP at Scale

Extract structured intelligence from clinical notes, pathology reports, and medical records

94% F1 on medical NER benchmarks

Entity extraction accuracy

[

healthcare

](/solutions/healthcare)

Who It's For

Healthcare IT teams, clinical informatics departments, and health systems processing thousands of clinical documents daily

[View Details](/use-cases/clinical-nlp)

## Related code examples and resources

Pages on the same stages, extractors and patterns.

[

Recipe

### BYO Embeddings Vector Search

Bring pre-computed embeddings from any provider (OpenAI, Cohere, Together, etc.) and upsert them directly into MVS for instant vector search. No feature extractors, no pipelines -- just embeddings in, results out.

Learn more





](/recipes/mvs-byo-embeddings-search)[

Extractor

### Document Graph Extractor

Decompose PDFs into spatial blocks (paragraphs, tables, forms, headers) with layout classification and E5 text embeddings.

Learn more





](/extractors/document-graph)[

Recipe

### Multimodal Hybrid Search Pipeline

Combine vector search with keyword search (BM25) across text, images, and video for the most comprehensive multimodal retrieval system.

Learn more





](/recipes/multimodal-hybrid-search)[

Recipe

### Clinical Documentation Structuring

Production-grade pipeline for ingesting clinical documents, scanned charts, EHR exports, wound photos, and therapy notes, and structuring them into coded fields aligned with MDS 3.0, PDPM, and CMS audit requirements. Combines OCR, clinical NER, taxonomy classification, and hybrid retrieval to turn unstructured bedside documentation into queryable, auditable data.

Learn more





](/recipes/clinical-documentation-structuring)[

Recipe

### Dense Search Over Your Own Embeddings, and What Hybrid Needs

Upsert documents you embedded elsewhere into an MVS namespace and search them by raw vector through the features search endpoint. Hybrid BM25 plus dense is not part of a plain BYO upsert: the documents carry dense vectors only and no text index is created. If you want a lexical leg later, declare a TEXT payload index on the field when you create the namespace; this recipe shows that declaration and the dense search that works today.

Learn more





](/recipes/mvs-hybrid-bm25-dense)[

Recipe

### Multimodal Search with MVS

Build multimodal search by embedding different content types (text, images, video frames) with your own models and searching across them in a single MVS namespace. Use CLIP or any multimodal embedding model for cross-modal retrieval.

Learn more





](/recipes/mvs-multimodal-search)