📚 Agent Knowledge

Search uploaded documents using semantic similarity for RAG-powered AI workflows.

Overview

The Agent Knowledge node enables RAG (Retrieval-Augmented Generation) in your workflows. Upload documents to your agent's knowledge base, then use this node to search them with semantic similarity. Feed the results into an AI Prompt node so your AI can answer questions grounded in your own data.

How It Works

  1. Upload documents — add PDF, DOCX, TXT, or Markdown files to your agent's Knowledge Base tab. Documents are automatically chunked and embedded using OpenAI text-embedding-3-small.
  2. Search with the node — the Agent Knowledge node converts your query into a vector embedding and performs a cosine similarity search against the stored chunks using pgvector.
  3. Feed results to AI — pass the search results to an AI Prompt node as context, enabling the AI to answer questions based on your documents.

Configuration

  • Query — the search text to find relevant documents. Supports{{variables}} for dynamic queries (e.g. {{$json.message}} or{{trigger.body}}).
  • Top K — number of results to return (default: 5). Higher values return more context but use more tokens.
  • Minimum Score — similarity threshold from 0.0 to 1.0 (default: 0.0). Set higher to filter out less relevant results.
  • Output Variable — variable name to store the search results (default: knowledge_results).
  • Include Metadata — whether to include source file name and chunk metadata in results.

Output Format

Results are stored in the output variable as an object with a results array. Each result includes:

  • {{knowledge_results.results[0].content}} — the matched text chunk
  • {{knowledge_results.results[0].score}} — similarity score (0.0 to 1.0)
  • {{knowledge_results.results[0].source}} — source file name (when metadata is enabled)

Common Use Cases

  • Customer support chatbot — upload product docs, FAQs, and policies so the AI can answer customer questions accurately
  • Internal knowledge assistant — upload company handbooks, SOPs, and training materials for employee self-service
  • Document Q&A — upload contracts, reports, or research papers and ask questions about their content

Supported File Types

  • PDF (.pdf)
  • Microsoft Word (.docx, .doc)
  • Plain text (.txt)
  • Markdown (.md)

Storage Options

Documents can be stored in Supabase Storage (default) or your own AWS S3 bucket. Configure S3 credentials in the agent settings to use your own storage.