Skip to main content
The vector database family stores text chunks in a vector index and finds the ones closest to a query. Two components do the work, database.vector.ingest and database.vector.retrieve. Neither talks to a database itself: each takes a provider on its database input, and the provider makes the call. The one provider today is database.vector.pinecone. A consumer’s database input takes the interface database.vector.inference, which database.vector.pinecone serves. It is required. A definition with nothing wired to it fails its check with Port `database` (category: `provider_input`) is required. If the connection is missing when the step runs anyway, the step posts a component.error event, Provider "database" is not connected, and takes its failure route.

Wiring a provider

A provider joins a consumer through a connection written from the consumer: its source is the consumer, with source_port provider_input, and its target is the provider, with target_port provider_reference. Its route is the name of the consumer’s provider input, database for both consumers here. The consumer finds its provider by that route, so a connection with any other route leaves database unconnected and the step posts Provider "database" is not connected.

database.vector.ingest

Writes a messages value to the index as text records. Each chunk becomes one record: its _id is the chunk’s attributes.id, or a new id when the chunk has none, and its text sits under the field named by text_field. Chunks are sent in batches of 96, and the step posts an output event for the total and for each batch. Wire the chunks of a text.chunk here, or any messages whose messages carry text. A batch the index refuses stops the step: it posts Failed to ingest batch and a component.error event carrying Pinecone’s own error message, and takes failure. The batches sent before it stay in the index, and no later batch is sent. An empty chunks sends nothing, and the step takes failure. A chunk with no text block, a missing credential or a request that fails without a reply also end in failure.

database.vector.retrieve

Searches the index with a text query and returns the closest chunks as a messages value. The editor turns reranking on for a new component. With rerank_enabled true, the search asks Pinecone to rerank with rerank_model, keeping rerank_top_n hits and reading rerank_fields. With it false, or left out of the definition, none of the rerank_* values is sent and every hit comes back in Pinecone’s order. The step splits rerank_fields on commas whenever it runs, so a definition always carries that port, with reranking on or off. Each hit becomes one message in chunks:
  • Its role is database, and its attributes.id is the id of the record.
  • Its metadata holds the hit’s score.
  • Its content holds one text block per name in query_fields, in that order, each with the field’s value. A hit that lacks one of the fields fails the step.
A search with no hits is a success with an empty chunks. A refused search posts a component.error event carrying Pinecone’s error message and takes failure; chunks is not written.

database.vector.pinecone

The provider for a Pinecone index. It calls Pinecone’s index API, at https://<index_host>/records/namespaces/<namespace>, with upsert for an ingest and search for a retrieve. Both use the namespace of the consumer. The request carries the credential’s key as Api-Key and api_version as X-Pinecone-API-Version. A request waits at most 5 seconds to connect and 60 seconds for a reply. A consumer wired to a provider whose credential names an alias that does not exist posts a component.error event, "<alias>" credential alias not found, and takes failure.

Example: a knowledge base for Corvel Freight

Corvel Freight keeps its carrier handbook in a Pinecone index. One flow reads the handbook, runs it through a text.chunk, and a database.vector.ingest writes the chunks to the namespace carrier-handbook with the default text_field. A second flow takes a driver’s question and a database.vector.retrieve searches that namespace with query_top_k set to 20, and with rerank_top_n set to 5 to keep the best five. Both consumers are wired to the same database.vector.pinecone, whose index_host is carrier-handbook-4f2a1c9.svc.aped-4627-b74a.pinecone.io and whose credential is pinecone-prod. The five messages in chunks go to a genai.chat as the context of the answer. The retrieve side, wired to the provider, looks like this. The credential pinecone-prod is an api_key credential of the organization.
The flow connections that start Search handbook and follow its success and failure routes, and the chunks output wired to a data component, are left out.