Portal Community

What is Retrieval-Augmented Generation (RAG)?

RAG is an AI pattern that enhances language model responses by first retrieving semantically relevant documents from a knowledge store, then including those documents as context in the AI prompt. This allows the AI to answer questions based on your specific, up-to-date business knowledge — rather than relying solely on its training data.

FlowRag handles the knowledge storage and retrieval half of this pattern. It converts text into numerical vector representations (embeddings), stores them in a vector database, and performs fast semantic similarity searches to find the most relevant content for any query.

What this node does: The FlowRag node provides managed vector storage and semantic search within BizFirst workflows. Insert knowledge items (policies, FAQs, product descriptions, contract clauses) into named collections, then query them with natural language at runtime to retrieve the most contextually relevant results. Supports PostgreSQL (pgvector) and Qdrant as vector backends.

Supported Operations

OperationDescription
insertAdd a new knowledge item to a collection. The text is embedded and stored with optional metadata tags.
updateUpdate an existing knowledge item by ID — replace its text, re-embed it, and update metadata.
deleteRemove a knowledge item from a collection by its ID.
queryPerform a semantic similarity search across a collection using a natural language query. Returns the top-K most relevant items above a similarity threshold.

Key Capabilities

Business Benefits

Domain-Specific AI Responses

Pre-load your business's policies, procedures, and product knowledge into FlowRag. When a customer asks a question, the query operation retrieves the relevant context and passes it to an LLM node — delivering accurate, company-specific answers rather than generic AI responses.

Knowledge Base Maintenance

Keep your AI knowledge current. When policies change or new products are added, use the update operation to refresh the corresponding knowledge items. Your AI-powered workflows will immediately reflect the latest information without re-training a model.

Scalable Document Retrieval

Replace manual document search with semantic similarity queries. A support agent workflow can retrieve the most relevant contract clauses, troubleshooting articles, or compliance requirements in milliseconds — dramatically reducing resolution time.

Multi-Collection Organisation

Organise knowledge into separate collections: one for HR policies, one for product documentation, one for legal contracts. Query only the relevant collection in each workflow context, improving retrieval precision and response quality.

Use Cases

Company Policy Q&A Bot

Build an employee self-service bot. Insert all HR, IT, and operations policies into FlowRag. When an employee asks a question, query the relevant collection and pass the results to a Claude/GPT node to generate a clear, policy-accurate answer.

Customer Support FAQ

Pre-load product FAQs and troubleshooting guides. When a support ticket arrives, use FlowRag to retrieve the three most relevant articles, then generate a personalised response using an AI node — with citations to the source articles.

Legal Document Retrieval

Index contract library contents. Lawyers and contract managers query FlowRag to find clauses, precedents, and similar contract language across thousands of documents in seconds.

Technical Documentation Search

Index API documentation, runbooks, and architecture decisions. Development teams query FlowRag to get contextually relevant technical guidance as part of automated ticket resolution workflows.

Product Recommendation

Store product descriptions, features, and customer use cases. When a customer describes their needs, semantically match to the most relevant products and surface personalised recommendations.

In This Guide

Configuration

Properties for all four operations: insert, update, delete, and query with scoring parameters.

Input & Output

Output ports, query result schema, and example retrieval output objects.

Examples

Five examples: policy insert, semantic query, support FAQ, metadata filter, and RAG pipeline.

Vector backend configuration: FlowRag requires a configured vector database backend. For PostgreSQL+pgvector, the credential must include a connection string to a database with the pgvector extension installed. For Qdrant, provide the Qdrant endpoint URL and API key. Configure the embedding model (e.g. OpenAI text-embedding-3-small) in the BizFirst AI settings.

Choosing a Vector Database Backend

BackendBest ForStrengthsConsiderations
PostgreSQL + pgvectorTeams already running PostgreSQLSingle database, SQL + vector in one system, familiar operational model, ACID transactionsRequires pgvector extension; performance degrades at very large scale (>10M vectors)
QdrantHigh-scale, high-performance RAGPurpose-built, excellent performance at scale, rich payload filtering, REST + gRPC APIs, cloud and self-hosted optionsAdditional infrastructure to manage; separate from application database

Embedding Model Selection

ModelProviderDimensionsBest For
text-embedding-3-smallOpenAI1536Default — excellent balance of quality and cost for general business content
text-embedding-3-largeOpenAI3072Highest accuracy for technical, legal, or scientific content where precision matters
text-embedding-ada-002OpenAI (legacy)1536Legacy compatibility only — prefer text-embedding-3-small for new collections
voyage-large-2Voyage AI1536Specialised for legal and financial document retrieval — outperforms OpenAI on dense text

The embedding model is configured per collection at the BizFirst workspace level. All items in a collection must use the same model — mixing models produces invalid similarity scores. To change the model, delete all items and re-insert with the new model.

Knowledge Base Design Tips

Common RAG Pipeline Pattern

The most common FlowRag workflow pattern follows these steps:

  1. Trigger — user submits a question (WebhookTrigger, FormTrigger, or ChatTrigger)
  2. FlowRag query — embed the question and retrieve the top-K most relevant knowledge items from the appropriate collection
  3. IfCondition — check result_count > 0 to decide whether to use retrieved context or fall back to a generic answer
  4. DataMapping — format the retrieved context into a prompt template combining question + context + instructions
  5. AI Chat or HTTP Request — send the formatted prompt to Claude or GPT and generate a grounded response
  6. Response — return the AI-generated answer to the user, optionally with citations from sources

This pattern ensures AI responses are grounded in your actual business knowledge rather than the model's general training data, dramatically reducing hallucination on domain-specific questions.

Combine with FlowAiAgent for Autonomous RAG

Register a FlowRag query as a tool in the BizFirst Tool Registry, then give it to a FlowAiAgent node. The agent will autonomously decide when to query the knowledge base — calling it multiple times with different queries if the first retrieval doesn't fully answer the goal. This pattern enables knowledge-augmented agents that can both reason and retrieve, without you needing to hard-code which knowledge base to query at each step.

Related Nodes

NodeRelationship to FlowRag
FlowAiAgentUse FlowRag as a registered tool inside the agent's reasoning loop for autonomous knowledge retrieval
ChatPass FlowRag context_text as the system or user context to ground chat responses in domain knowledge
LoopLoop over a document array and call FlowRag insert on each item for bulk knowledge base ingestion
IfConditionCheck result_count > 0 after a query to branch between "answer found" and "fallback" paths
DataMappingFormat retrieved results into a structured AI prompt before passing to a Chat or HTTP Request node