Knowledge Base Insert
Knowledge Base Insert writes the embedded chunks from Embed into a knowledge base. It is the final node of the ingest pipeline: after it runs, the chunks are searchable. You find it on the node picker’s AI shelf.
Ingest: Read a File as Text → Split Text → Contextualize Chunks (optional) → Embed → Knowledge Base InsertRead back: Knowledge Base Query (search) or Read Knowledge Base (read whole)

The node has one input handle and one output handle.
Give it a source key
Section titled “Give it a source key”Without a source key the node is append-only: a scheduled ingest re-stores its whole corpus every run, the knowledge base grows without bound, and retrieval decays as copies of the same chunk crowd out variety. With one, re-running the flow replaces each source’s stored chunks instead of appending, so a re-run is a refresh that also picks up edits to the source. Two ways to set it:
sourceKeyPathnames a key inside each chunk’s own metadata (a dot path such asidorarticle.id), read per chunk, so one insert can carry chunks from many sources.sourceKeynames the single source all of this insert’s chunks came from, resolved once per run. Use it when the chunks carry no id of their own but the flow knows one:
{!! $start->url !!}sourceKey takes precedence when both are set. Chunks whose key is missing or empty append.
Configuration
Section titled “Configuration”

| Field | Type | Default | Description |
|---|---|---|---|
Knowledge base (collectionId) | string ✦ (required) | — | The knowledge base that the embedded chunks are written into. |
Source key path (sourceKeyPath) | string ✦ (optional) | — | The metadata key holding the id of the source each chunk came from, e.g. “id”. Set it, and re-running the flow refreshes each source instead of storing a second copy of it. Leave it empty and every run appends. |
Source key (sourceKey) | string ✦ (optional) | — | Identifies the single source that ALL of these chunks came from. Only needed when the source id is not in the chunk metadata — prefer the metadata key above. |
Fields marked ✦ accept expressions.
Try this node — run it once against your own workspace, with your credentials, without building a flow first.
Output
Section titled “Output”{ "inserted": 12, "replaced": 12, "collection_id": "01kta3s3r8292bh37btk6m947y"}inserted counts what actually landed; a chunk missing its text or embedding is skipped. replaced counts the previously stored chunks that were dropped for the same source keys.
Example
Section titled “Example”The template Rag / VectorStore / Insert under Automation → Templates injects two chunks with metadata, embeds them with text-embedding-3-small, and inserts them into a demo knowledge base. The Rag / Contextualize template shows the same insert with a sourceKey set, so its re-runs refresh rather than duplicate.
Limitations
Section titled “Limitations”- The vectors must match the knowledge base’s dimension. A mismatch fails the node before anything is deleted or written.
- The knowledge base records which provider and model embedded it, taken from the first write. A later insert embedded with a different model is refused, because vectors from two models are not comparable and mixing them silently breaks every search.
- Writes are refused while the knowledge base is being re-embedded to another model; reads keep working throughout.
- Each stored chunk’s metadata also records which flow and node wrote it, under a reserved
_publicuskey, so a mis-ingested corpus can name the flow to fix.
Related
Section titled “Related”- Embed is the node before this one, and what it reports is how the knowledge base learns which model it holds.
- Knowledge Base Query searches what this node stored.
- Read Knowledge Base reads it back whole.
- Knowledge Base Delete removes sources that no longer exist upstream.
- Knowledge bases covers creating and inspecting knowledge bases.
- How to choose between searching and reading covers how agents use what you ingest.