Use it in Workflows and Agents
Retrieve chunks from a workflow step, or connect a knowledge base to an AI agent for retrieval-augmented generation.
Workflows and AI agents query a knowledge base through the Knowledge Base component. Use it as a workflow action or attach it to an AI agent as a tool or vector store.
Search from a workflow step
Add the Knowledge Base Search Data action to a workflow to fetch the most relevant chunks for a query.
| Property | Type | Default | Description |
|---|---|---|---|
| Knowledge Base | Select | - | Required. The knowledge base to search. |
| Query | String | - | The natural-language text to match. Leave it empty for a filter-only search. |
| Tags | Array | - | Restrict the search to documents with at least one of the given tags. |
| Metadata Filter | Array | - | Metadata key-value pairs applied before ranking. Entries within a group are combined with AND; groups are combined with OR. |
| Top K | Integer | 10 | Maximum number of chunks to return. |
| Similarity Threshold | Number | 0.0 | Minimum relevance score (0.0 to 1.0). Chunks with a lower score are dropped. |
The action returns an array of matching chunks, each with its content, relevance score, and metadata, for use in a prompt, a condition, or another step.
Ground an AI agent (RAG)
Attach the Knowledge Base component to an AI agent so the agent retrieves context from your documents:
| Cluster element | Description |
|---|---|
| Knowledge Base VectorStore | The agent searches the knowledge base automatically when it answers. Optionally restrict it with Tags. |
| Knowledge Base Search (tool) | The agent decides when to search the knowledge base. |
| Load Knowledge Base Documents (tool) | The agent can add text content to the knowledge base. |
| Update Knowledge Base Documents (tool) | The agent can update documents or chunks in the knowledge base. |
In both retrieval modes, the flow is:
User question → embed → nearest chunks from the knowledge base → chunks added to the prompt → model answersFiltering by tag
When one knowledge base holds distinct kinds of content, set Tags so a workflow or agent
retrieves only the intended documents. A document matches when it has at least one of the
requested tags. For example, an agent restricted to policy never retrieves a chunk from an
untagged product specification in the same knowledge base.
Retrieval quality depends on ingestion
If an agent gives vague answers, check the chunk settings and confirm that the expected documents are Ready.
Write to a knowledge base from a workflow
The Knowledge Base component also has actions that change a knowledge base:
| Action | Description |
|---|---|
| Load Data | Loads data into the knowledge base as documents, using the document reader configured on the step. Optionally adds Additional Metadata. The documents are chunked and embedded like uploaded files. |
| Update Documents | Updates the content of a Document or a Document Chunk, or of multiple documents matched by Metadata Filter when Update Multiple is on. |
| Delete Documents | Deletes documents that match a metadata filter. |
Coming soon
Scheduled sources that keep a knowledge base in sync with an external system are not available in the latest released version of ByteChef.
How is this guide?
Last updated on