Skip to content
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions docs/docs/extraction/concepts.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@ These terms appear throughout NeMo Retriever Library documentation.

## Job { #job }

An **ingestion job** is a unit of work you run on input content (documents, audio, video, and other supported types). You submit jobs through the **ingestor Python API** (for example `Ingestor` task chains such as `.extract(...)`) or the **`retriever ingest` CLI**—not by posting a standalone JSON job document. Default tasks target strong recall; customize behavior with task keyword arguments (including chunking and splitting on `.extract()`) or custom UDF-style operations ([NeMo Retriever graph](https://github.com/NVIDIA/NeMo-Retriever/tree/main/nemo_retriever/src/nemo_retriever/graph#nemo-retriever-graph)). Results are structured metadata and annotations (Ray Dataset, pandas `DataFrame`, or similar).
An **ingestion job** is a unit of work you run on input content (documents, audio, video, and other supported types). You submit jobs through the **ingestor Python API** (for example `Ingestor` task chains such as `.extract(...)`) or the **`retriever ingest` CLI**—not by posting a standalone JSON job document. Default tasks target strong recall; customize behavior with task keyword arguments (including chunking and splitting on `.extract()`) or custom UDF-style operations. For UDFs and other extension paths, refer to [Customize & extend](customize-extend.md). Results are structured metadata and annotations (Ray Dataset, pandas `DataFrame`, or similar).

## Pipeline and tasks { #pipeline-and-tasks }

NeMo Retriever Library does **not** run one static pipeline on every document. You configure **tasks** such as parsing, chunking, embedding, storage, and filtering per job. Related topics: [Extending/Customizing NeMo Retriever Library with custom code](https://github.com/NVIDIA/NeMo-Retriever/tree/main/nemo_retriever/src/nemo_retriever/graph#nemo-retriever-graph).
NeMo Retriever Library does **not** run one static pipeline on every document. You configure **tasks** such as parsing, chunking, embedding, storage, and filtering per job. For UDFs, custom graph stages, and other extension paths, refer to [Customize & extend](customize-extend.md).

## Extraction metadata { #extraction-metadata }

Expand Down
81 changes: 81 additions & 0 deletions docs/docs/extraction/customize-extend.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,81 @@
# Customize & extend

NeMo Retriever Library ships with defaults tuned for strong recall on common document types. When those defaults are not enough, you can extend the library at several levels—from task keyword arguments on the fluent ingestor API through custom graph operators and vector-database adapters.

Use this page to choose an extension path and find the detailed guides in the repository.

The following table maps common needs to the right section:

| If you need to… | Start here |
|-----------------|------------|
| Tune extraction, chunking, embedding, or upload without new code | [Start with task configuration](#start-with-task-configuration) |
| Add a small Python transformation between pipeline stages | [User-defined functions (UDFs)](#user-defined-functions-udfs) |
| Build or reuse operators stage-by-stage | [Custom graph pipelines](#custom-graph-pipelines) |
| Store vectors in a backend other than LanceDB | [Custom vector databases](#custom-vector-databases) |
| Wire a non-default embedding model | [Custom embedding models](#custom-embedding-models) |

## On this page { #on-this-page }

- [Start with task configuration](#start-with-task-configuration)
- [User-defined functions (UDFs)](#user-defined-functions-udfs)
- [Custom graph pipelines](#custom-graph-pipelines)
- [Custom vector databases](#custom-vector-databases)
- [Custom embedding models](#custom-embedding-models)
- [Related Topics](#related-topics)

## Start with task configuration { #start-with-task-configuration }

Most customization does not require new code. Chain tasks on `create_ingestor(...)` and pass keyword arguments to control extraction, chunking, embedding, and storage—for example `extract_method`, chunking and splitting options on `.extract()`, `embed_modality` on `.embed()`, and `vdb_op` / `vdb_kwargs` on `.vdb_upload()`.

For parameter details, refer to the [Python API guide](nemo-retriever-api-reference.md). For chunking behavior and pipeline concepts, refer to [Concepts](concepts.md).

## User-defined functions (UDFs) { #user-defined-functions-udfs }

A **user-defined function (UDF)** wraps your Python logic as a first-class pipeline stage. In the graph model, `UDFOperator` turns a plain callable into an operator you can chain with built-in stages—for example to normalize HTML, apply a custom split, or call an external service between extract and embed steps.

Use UDFs when you need a small, self-contained transformation that is not covered by task keyword arguments.

### Repository guides and examples

- [NeMo Retriever graph README — `UDFOperator`](https://github.com/NVIDIA/NeMo-Retriever/tree/main/nemo_retriever/src/nemo_retriever/graph#using-udfoperator) — API, lifecycle, and when to use `UDFOperator` versus a custom operator class
- [UDF example scripts](https://github.com/NVIDIA/NeMo-Retriever/tree/main/examples/udfs) — sample implementations such as HTML-to-Markdown conversion and structural splitting
Comment thread
charlesbluca marked this conversation as resolved.
Outdated
- [NimClient and custom NIM endpoints](https://github.com/NVIDIA/NeMo-Retriever/blob/main/nemo_retriever/developer_docs/nimclient.md#nimclient-and-custom-nim-endpoints) — call custom or self-hosted NIM microservices from UDF stages

## Custom graph pipelines { #custom-graph-pipelines }

When you need to compose pipelines stage-by-stage, reuse operators across workflows, or run the same graph in-process or with Ray Data, use the **graph execution model** instead of (or alongside) the fluent `GraphIngestor` API.

The graph package provides `AbstractOperator`, executors (`InprocessExecutor`, `RayDataExecutor`), and operator chaining with `>>`. Built-in ingestion operators live under `nemo_retriever.operators`; you can add your own operators or UDF stages anywhere in the chain.

For the full guide—including custom operator classes, executors, and graph shape constraints—refer to the [NeMo Retriever graph README](https://github.com/NVIDIA/NeMo-Retriever/tree/main/nemo_retriever/src/nemo_retriever/graph#nemo-retriever-graph).

## Custom vector databases { #custom-vector-databases }

The supported user path for vector storage is **[LanceDB](vdbs.md)** (`vdb_op="lancedb"`). That page covers upload, semantic retrieval, metadata filtering, and LanceDB deployment characteristics.

To integrate a different vector store, implement the [`VDB`](https://github.com/NVIDIA/NeMo-Retriever/blob/main/nemo_retriever/src/nemo_retriever/common/vdb/adt_vdb.py) interface and wire it through graph [`IngestVdbOperator`](https://github.com/NVIDIA/NeMo-Retriever/blob/main/nemo_retriever/src/nemo_retriever/operators/vdb.py) / [`RetrieveVdbOperator`](https://github.com/NVIDIA/NeMo-Retriever/blob/main/nemo_retriever/src/nemo_retriever/operators/vdb.py). NVIDIA validates the first-party LanceDB operator; you are responsible for testing and maintaining other backends.

### Repository guides

- [Build a custom vector database operator (notebook)](https://github.com/NVIDIA/NeMo-Retriever/blob/main/examples/building_vdb_operator.ipynb) — step-by-step walkthrough
Comment thread
charlesbluca marked this conversation as resolved.
Outdated
- [Vector DB package (source)](https://github.com/NVIDIA/NeMo-Retriever/tree/main/nemo_retriever/src/nemo_retriever/common/vdb) — `VDB` abstract base and LanceDB reference implementation

Partner and blueprint integrations (Elasticsearch, Pinecone, Teradata, and others) are summarized on [Vector databases — Vector database partners](vdbs.md#vector-database-partners).

## Custom embedding models { #custom-embedding-models }
Comment thread
charlesbluca marked this conversation as resolved.
Outdated

!!! note "Coming soon"
Comment thread
kheiss-uwzoo marked this conversation as resolved.
Outdated

Dedicated documentation for wiring custom embedding models into ingestion graphs is in progress. Today, configure embedding through task parameters and environment variables:

- [Multimodal embeddings (VLM)](embedding.md) — default and multimodal embed flows
- [Environment variables](environment-config.md) — `*_ENDPOINT` variables for self-hosted or hosted NIM embed services
- [NeMo Retriever Text Embedding NIM](https://docs.nvidia.com/nim/nemo-retriever/text-embedding/latest/overview.html) — OpenAI-compatible text embedding NIM

## Related Topics { #related-topics }

- [Concepts — Pipeline and tasks](concepts.md#pipeline-and-tasks)
- [Vector databases](vdbs.md)
- [Multimodal embeddings (VLM)](embedding.md)
- [Python API guide](nemo-retriever-api-reference.md)
- [Starter kits and notebooks](starter-kits.md)
3 changes: 2 additions & 1 deletion docs/docs/extraction/vdbs.md
Original file line number Diff line number Diff line change
Expand Up @@ -150,11 +150,12 @@ Testing and release cadence for these integrations follow the owning project (RA

NVIDIA documents and validates the first-party LanceDB operator for this library. If you integrate a different vector store, you are responsible for testing and maintaining that integration.

To implement a custom operator, follow the `VDB` abstract interface described in [Build a Custom Vector Database Operator](https://github.com/NVIDIA/NeMo-Retriever/blob/main/examples/building_vdb_operator.ipynb).
To implement a custom operator, follow the `VDB` abstract interface described in [Build a Custom Vector Database Operator](https://github.com/NVIDIA/NeMo-Retriever/blob/main/examples/building_vdb_operator.ipynb). For an overview of all customization paths (UDFs, graph pipelines, and embeddings), refer to [Customize & extend](customize-extend.md).

## Related Topics { #related-topics }

- [Metadata and filtering](#metadata-and-filtering)
- [Customize & extend](customize-extend.md)
- [Vector DB operators and LanceDB (source)](https://github.com/NVIDIA/NeMo-Retriever/tree/main/nemo_retriever/src/nemo_retriever/common/vdb)
- [Use the NeMo Retriever Library Python API](nemo-retriever-api-reference.md)
- [Store Extracted Images](nemo-retriever-api-reference.md)
Expand Down
7 changes: 5 additions & 2 deletions docs/mkdocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ nav:
- "7. Deployment & operations":
- "Ray and distributed ingest": extraction/ray-logging.md
- "8. Customize & extend":
- Extending/Customizing NeMo Retriever Library with custom code: https://github.com/NVIDIA/NeMo-Retriever/tree/main/nemo_retriever/src/nemo_retriever/graph#nemo-retriever-graph
- "Customize & extend": extraction/customize-extend.md
- "9. Integrations & ecosystem":
- "Starter kits": extraction/starter-kits.md
- "10. Evaluation & benchmarks":
Expand Down Expand Up @@ -185,7 +185,10 @@ plugins:
extraction/chunking.md: extraction/concepts.md#chunking
extraction/quickstart-library-mode.md: extraction/deployment-options.md
extraction/workflow-video-ocr.md: extraction/audio-video.md
extraction/user-defined-stages.md: https://github.com/NVIDIA/NeMo-Retriever/tree/main/nemo_retriever/src/nemo_retriever/graph#nemo-retriever-graph
extraction/user-defined-stages.md: extraction/customize-extend.md
extraction/user-defined-functions/index.md: extraction/customize-extend.md#user-defined-functions-udfs
extraction/user-defined-functions.md: extraction/customize-extend.md#user-defined-functions-udfs
extraction/customize-and-extend.md: extraction/customize-extend.md
extraction/nimclient.md: https://github.com/NVIDIA/NeMo-Retriever/blob/main/nemo_retriever/developer_docs/nimclient.md#nimclient-and-custom-nim-endpoints
- site-urls

Expand Down
Loading