For AI agents: a documentation index is available at the root level at /llms.txt and /llms-full.txt. Append /llms.txt to any URL for a page-level index, or .md for the markdown version of any page.
Dashboard
User GuideDeveloper GuidesAPI Reference
User GuideDeveloper GuidesAPI Reference
  • Getting Started
    • What is Runtype?
    • Creating your account
    • Platform Keys vs. BYOK
    • Understanding the Runtype UI
    • Quickstart: Social Media Post Generator
    • Quickstart: From Agent to Chat Widget
  • Dashboard
    • What is the Dashboard?
    • Daily Executions
  • Playground
    • What is the Playground?
  • Products & Surfaces
    • What are Products?
    • What are Surfaces?
    • Creating a Product
    • Setting up a Chat Surface
    • Setting up an API Surface
    • Setting up an MCP Surface
    • Setting up an A2A Surface
    • Setting up a Slack Surface
    • MCP authentication
    • Authenticating with product API keys
    • Embedding the chat widget (script tag)
    • Embedding the chat widget (React)
    • Surface orchestration modes
    • Product views
    • Adding Capabilities to a product
    • Connecting external agents
    • How A2A works
    • Connecting to Cursor / VS Code
    • Connecting to Claude Desktop
    • Scoping API keys to capabilities
    • Auto-generated OpenAPI spec
    • Calling your API endpoints
    • Client tokens and domain restrictions
    • AI-powered theme generation
    • Widget theming and customization
    • Product versioning and status
  • Flows
    • What are Flows?
    • Creating and Editing Flows
    • Flow step types overview
    • Agent and Flow Templates
    • Using prompt steps
    • Using transform-data steps
    • Using conditional steps
    • Using fetch-url and api-call steps
    • Using record steps (upsert/retrieve)
    • Flow variables and templates
    • Flow versioning and publishing
    • Running flows in batch
    • Handling batch failures
    • Debugging flows
  • Agents
    • What are Agents?
    • Creating and configuring Agents
    • Agent tools
  • Records
    • What are Records?
    • Creating and managing records
    • Using records in flows
    • Filtering and searching records
  • Tools
    • What are Tools?
    • Built-in Tools
    • Creating custom tools
    • Creating external tools
    • Runtime tools
  • Evals
    • What are Evals?
    • Running an Eval
    • Interpreting eval results
  • Schedules
    • What are Schedules?
    • Automating batch processing
  • Logs
    • What are Logs?
    • Working with Logs
  • Integrations
    • Connecting AI model providers
    • Slack integration
    • Google Workspace integration
    • GitHub integration
    • Linear integration
    • Weaviate (vector search)
    • Firecrawl (web scraping)
    • Exa (web search)
  • Settings
    • What's in Settings?
    • Available AI models
    • What are Organizations?
    • Managing AI models
    • Managing API keys
    • Billing and plans
    • Usage data
    • Team members and permissions
    • Appearance and preferences
    • Integrations (PostHog, Weaviate, Daytona)
  • Troubleshooting & FAQ
    • FAQ
    • Rate Limits and Usage
    • Managing Runtype with Claude
    • Flow execution failures
    • Common errors and solutions
    • Authentication issues
Dashboard
LogoLogo
On this page
  • Common patterns
  • RAG: Question answering with context
  • Personalization with customer data
  • Caching API results
  • Conversation history
  • Record lookups
  • Multi-record retrieval
  • Updating records from flows
  • Optimizing record usage
  • Error handling
  • Best practices
  • Example: Full RAG flow
  • Next steps
Records

Using records in flows

Was this page helpful?
Previous

Filtering and searching records

Next
Built with

Integrate records into flows to provide context, personalize responses, and implement RAG (Retrieval Augmented Generation) patterns.

Common patterns

RAG: Question answering with context

Retrieve relevant documents and include them in AI prompts:

  1. Vector Search: Find docs matching user question (semantic search)
  2. Transform Data: Extract and format retrieved content
  3. Prompt: Generate answer using retrieved context

Example prompt:

Answer this question using only the provided context.
Question: {{input.question}}
Context:
{{searchResults.output[0].metadata.content}}
{{searchResults.output[1].metadata.content}}
If the context doesn't contain relevant information, say "I don't have enough information to answer that."
Answer:

Personalization with customer data

Retrieve customer profile and use it for personalized responses:

  1. Retrieve Record: Get customer by ID, name, or type
  2. Prompt: Generate response referencing customer data

Example:

Customer message: {{input.message}}
Customer info:
- Name: {{customerData.output.metadata.name}}
- Tier: {{customerData.output.metadata.tier}}
- Order history: {{customerData.output.metadata.orderCount}} orders
Provide a personalized, helpful response appropriate for their tier level.

Caching API results

Save expensive API calls in records:

  1. Retrieve Record: Check if cached result exists
  2. Conditional: If cache miss, call external API
  3. Upsert Record: Save API response for future use
  4. Return: Cached or fresh result

Conversation history

Store chat logs for context in future interactions:

  1. Retrieve Record: Get conversation history by user ID
  2. Prompt: Generate response with conversation context
  3. Upsert Record: Update conversation history with new exchange

Record lookups

Retrieve specific records by ID or by type and name:

Step: Retrieve Record
Record ID: {{input.customerId}}
Output variable: customerLookup

Or query by type with a record filter:

Step: Retrieve Record
Retrieval mode: query
Record type: customers
Output variable: customerLookup

Use in conditionals to check if a record exists:

Conditional: {{customerLookup.output}} != null
If true: Use existing customer data
Else: Create new customer record

Multi-record retrieval

Use a Retrieve Record step in query mode or a Vector Search step to get multiple results:

  1. Vector Search: Find matching products by semantic similarity
  2. Transform Data: Extract and format results
  3. Prompt: Process or summarize the matches

Updating records from flows

Flows can create or update records using the Upsert Record step. The step identifies records by type and name, and stores the contents of a source variable as metadata:

Step: Upsert Record
Record type: analytics
Record name: {{input.eventId}}
Source variable: analysisResult
Output variable: upsertedRecord

There is also an Update Record step for modifying specific metadata fields on an existing record without replacing the entire metadata object.

Use Vector Search for unstructured queries (“How do I…?”) and Retrieve Record for structured lookups (“Get customer with ID 12345”).

Optimizing record usage

  • Limit search results: Only retrieve what you need
  • Cache retrieved data: Store in variables, don’t retrieve multiple times
  • Use specific types: Searching within a type is faster than all records
  • Filter before semantic search: Narrow scope for better performance

Error handling

Handle missing records gracefully:

Conditional: {{recordLookup.output}} == null
If true:
Return: "Customer not found"
Else:
Continue processing with record data

Best practices

  • Keep record metadata concise: Only store fields you’ll query or use in prompts
  • Use meaningful record types: Organize records logically
  • Test search relevance: Verify semantic search returns appropriate results
  • Monitor record count: Large record sets need indexed fields
  • Version control: Don’t delete old records; mark them inactive instead

Example: Full RAG flow

1. Vector Search
Record type: documentation
Query: {{input.userQuestion}}
Limit: 3
Output variable: searchResults
2. Transform Data
// Format context from top 3 results
const context = steps.searchResults.output
.map(r => r.metadata.content)
.join('\n\n');
return { context };
3. Prompt
Answer the question using this context:
Context: {{formatContext.output.context}}
Question: {{input.userQuestion}}
Answer:
4. Return
{{answerQuestion.output}}

Next steps

  • Using record steps for detailed step configuration
  • Filtering and searching records for advanced queries
  • Creating and managing records to populate your record store
  • Using prompt steps to generate responses with record context