ByteChef LogoByteChef
Automation

Knowledge Base

Upload documents that ByteChef chunks and embeds, and search them by meaning from workflows and AI agents.

A knowledge base is a collection of documents that ByteChef ingests, splits into chunks, and embeds into vectors so they can be searched by meaning rather than by exact keywords. It is the retrieval layer behind Retrieval-Augmented Generation (RAG): a workflow or AI agent asks a question, the knowledge base returns the most relevant chunks, and the model answers grounded in your own content.

Open knowledge bases from Knowledge Base in the Automation sidebar. Each knowledge base is scoped to a workspace and an environment, so documents in DEVELOPMENT are isolated from PRODUCTION.

Prerequisites

  • The Knowledge Base is enabled with BYTECHEF_AI_KNOWLEDGE_BASE_ENABLED=true (default false). Without it, Knowledge Base does not appear in the Automation sidebar.
  • An embedding model is enabled for the environment in AI Providers (OpenAI, Mistral, or Ollama). Without one, the page shows Turn on an embedding model with a Go to AI Providers button, and you cannot upload or search documents.

What you can do

How it works

  1. Ingest - You upload a file. ByteChef extracts its text, running OCR first for scanned PDFs and images when OCR is configured.
  2. Chunk - The text is split into overlapping chunks sized by the knowledge base's chunking settings.
  3. Embed - Each chunk is turned into a vector by the configured embedding model and stored alongside the chunk text and metadata.
  4. Retrieve - A query is embedded the same way, and the nearest chunks are returned with a similarity score, optionally filtered by metadata or tags.

Where the vectors live

Chunks and their embedding vectors are stored in Postgres through the pgvector extension; there is no separate vector database. The backup and monitoring of the ByteChef database cover the knowledge base. Because the vectors are ordinary columns, one query can filter on chunk metadata and rank by vector similarity.

To run the vector workload on its own instance, point pgvector at a separate database:

VariablePurposeDefault
BYTECHEF_AI_VECTORSTORE_PROVIDERVector store backend.PGVECTOR
BYTECHEF_AI_VECTORSTORE_PGVECTOR_URLJDBC URL of the pgvector database. Leave unset to use the main database.-
BYTECHEF_AI_VECTORSTORE_PGVECTOR_USERNAME / _PASSWORDCredentials for that database.-
BYTECHEF_AI_VECTORSTORE_PGVECTOR_DIMENSIONSWidth of the stored embedding vectors.1536

The index uses HNSW, cosine distance, and 1536 dimensions, the size of the default OpenAI embedding model. If you use an embedding model with a different vector width, set BYTECHEF_AI_VECTORSTORE_PGVECTOR_DIMENSIONS to match. See AI Providers → Embedding models.

See the AI Vectorstore configuration reference for the full list.

Configuration

Text extraction handles digital PDFs without OCR. Scanned pages and images need OCR, which is configured per deployment.

VariablePurposeDefault
BYTECHEF_AI_KNOWLEDGE_BASE_ENABLEDMaster switch for the Knowledge Base.false
BYTECHEF_AI_KNOWLEDGE_BASE_OCR_PROVIDERNONE, AZURE, or MISTRAL.NONE
BYTECHEF_AI_KNOWLEDGE_BASE_OCR_MISTRAL_API_KEYMistral OCR API key.-
BYTECHEF_AI_KNOWLEDGE_BASE_MAX_SIZE_BYTESMaximum total size, in bytes, of all knowledge base documents in a tenant. 0 means unlimited. An upload that would exceed it fails with an error that asks you to delete documents or raise the limit.1073741824 (1 GB)

MISTRAL is the only OCR provider with an implementation. AZURE is accepted by the configuration but behaves like NONE.

OCR runs during ingestion, before chunking. The extracted text is then chunked, embedded, and indexed like any other document.

Isolation

A knowledge base is scoped to a workspace and an environment, and on multi-tenant deployments each tenant's documents and vectors live in that tenant's own database or schema. There is no query path that spans tenants.

How is this guide?

Last updated on

On this page