Pipelines
A pipeline is the container for one body of content and the rules that govern how Foundation4 processes and retrieves that content. This page describes the settings that define a pipeline, the search indexes that a pipeline receives at creation, which settings can change after creation, and how Foundation4 stores the content of each pipeline. Integrators and administrators need this page before creating a pipeline.
Pipeline settings
A pipeline is created with POST /pipelines. The request defines the following settings.
| Setting | Field | Required | Description |
|---|---|---|---|
| Name | name | Yes | A name that is unique across the deployment |
| Description | description | No | Free text for administrators |
| Embedding model | embedding_model_id | No | The embedding model of the pipeline's first vector index, which converts fragments and queries into vectors for similarity and MMR search |
| Text index | full_text_search | No | The kind of the pipeline's first text index: fts for a full-text index, bm25 for a BM25 index. Omitted or null, the pipeline has no text index. |
| BM25 tokenizer | bm25_tokenizer | No | The tokenizer of the BM25 index, only with full_text_search set to bm25. The default is the built-in bert_base_uncased tokenizer. BM25 tokenizers lists the options. |
| Default text splitter | default_text_splitter_id | Yes | The text splitter applied to each document that does not name a text splitter |
| Classifications | classifications | Yes | The classifications that documents in the pipeline can carry, with any inheritance between those classifications |
| Metadata schema | schema | No | A JSON Schema that document metadata must satisfy. The default is an empty schema, which accepts any metadata. |
The embedding model and the text splitter must exist before the pipeline is created. A request that omits a required setting returns HTTP 422, a request that names an embedding model or a text splitter that does not exist returns HTTP 404, and a name that another pipeline already uses returns HTTP 409 with the message Conflict unique error. A bm25_tokenizer without full_text_search set to bm25 returns HTTP 400 with details.error set to bm25_tokenizer requires full_text_search to be bm25. In each case, no pipeline is created. A new installation includes one embedding model and three text splitters, so a pipeline can be created without configuring a provider first. Embedding models and text splitters describes both object types.
Search indexes
The two search settings create the pipeline's first search indexes. embedding_model_id creates a vector index, on VectorChord, for similarity and maximal marginal relevance (MMR) search. full_text_search creates a text index for full-text search. Each index becomes the pipeline's default index of its kind, which searches use when the request names no index. A pipeline can have both kinds, and hybrid search fuses the results of the two.
A pipeline created without an embedding model and with a text index is a full-text-only pipeline: Foundation4 splits and stores the documents but computes no vectors, which removes the embedding cost from ingestion. A similarity or MMR search on a pipeline without a vector index returns HTTP 400 with details.error set to No search indexer given and the pipeline has no default vector search indexer. The search_knowledge tool of the MCP server searches a full-text-only pipeline with its text and latest search types.
The search indexes are not fixed at creation. POST /pipelines/{id}/search-indexers adds a vector index for any embedding model, a full-text index or a BM25 index to a pipeline that already holds documents, and the workers fill the new index from the stored fragments without a new ingestion. A pipeline can therefore move to another embedding model, or gain full-text search, after creation. Search indexes describes the index kinds, the defaults and the operations that manage indexes.
A create request with a field that the request does not define returns HTTP 422 and creates no pipeline. The message starts with Failed to deserialize the JSON body into the target type: unknown field and names the field and the expected fields. The field of earlier releases, has_full_text_search, is refused in the same way, and full_text_search replaces the field.
Settings that can change
PATCH /pipelines/{id} changes the following settings:
- Name and description. The name must remain unique, and a
descriptionofnullclears the description. - Default text splitter. The new text splitter applies to documents submitted after the change. Fragments of documents already processed are not recomputed. A text splitter that does not exist returns HTTP 404, and the pipeline keeps the previous text splitter.
- Metadata schema. The new schema applies to the metadata of documents submitted after the change and to every subsequent metadata filter. Metadata already stored is not validated again.
The response to PATCH /pipelines/{id} shows the pipeline with the new settings. Search indexes are not changed through PATCH: an index field such as embedding_model_id or full_text_search, like any other field that the update request does not define, returns HTTP 422 and changes nothing. The operations under /pipelines/{id}/search-indexers add, remove and switch indexes.
Classifications are managed through a separate endpoint, POST /pipelines/{id}/classifications, which adds and removes classifications and inheritance relationships. The Classifications page describes the effect of each change, including the deletion of documents when a classification is removed.
Storage
Foundation4 creates a dedicated set of tables and indexes in PostgreSQL for each pipeline, and a dedicated table for each search index. The size and query load of one pipeline therefore do not affect the indexes of another pipeline, and deleting a pipeline or a search index removes the tables in one operation.
| Table | Contents | Index |
|---|---|---|
| Classifications | The pipeline's classifications, each with a dedicated encryption key | Unique index on the classification name |
| Hierarchy | The inheritance relationships between classifications | Primary key on each relationship |
| Texts | One row per fragment: encrypted fragment text, document identifier, version, position, expiry time and metadata | Indexes on document and version, and on classification and metadata |
| Vectors, one table per vector index | One vector per fragment, from the index's embedding model | One approximate nearest-neighbor index per distance strategy: vchordrq on VectorChord, hierarchical navigable small world (HNSW) on pgvector |
| Full-text, one table per pipeline | One text search vector per fragment, with the text search configuration of the fragment's language, when the pipeline has a full-text index | Generalized inverted index (GIN) for word lookup, and an index on the configuration |
| BM25, one table per BM25 index | One BM25 token vector per fragment, from the index's tokenizer | BM25 index for ranked token lookup |
Fragment text is encrypted with the key of the fragment's classification. Vectors, full-text and BM25 index entries and metadata are stored unencrypted, because PostgreSQL compares these values directly during search. Security at a glance summarizes the encryption model.
Deleting a pipeline
DELETE /pipelines/{id} deletes the pipeline, every document and version in the pipeline, and the pipeline's tables. The deletion is permanent. Foundation4 keeps no copy of the raw text of a processed document, so recovering deleted content requires a new ingestion from the source system or a database restore.