Using Vectors with AI Agents
Learn how to configure vectors for AI agents to enable RAG (Retrieval-Augmented Generation)
Using Vectors with AI Agents
Vectors are integrated with AI agents to enable RAG (Retrieval-Augmented Generation), allowing agents to retrieve relevant context from your data and provide more accurate, context-aware responses.
What is RAG?
RAG (Retrieval-Augmented Generation) combines:
- Retrieval: Finding relevant information from vector stores
- Augmentation: Adding retrieved context to AI agent prompts
- Generation: AI agent generates responses using retrieved context
This enables AI agents to:
- Access Your Data: Use your actual data as context
- Provide Accurate Answers: Answer questions based on your data
- Stay Up-to-Date: Use current data, not just training data
- Domain-Specific: Understand your specific domain and terminology
How Vectors Work with AI Agents
Vector Configuration
When configuring an AI agent, you can associate vectors:
- Select Vector: Choose a vector store to use with the agent
- Configure Parameters: Set search parameters (top-K, similarity threshold)
- Filter Data Sources: Optionally filter to specific Objects/Files/Reports
- Enable RAG: Agent uses vector for context retrieval
Context Retrieval Process
When an AI agent receives a query:
- Query Analysis: Agent analyzes the user's query
- Vector Search: Agent searches the configured vector(s) for relevant context
- Context Retrieval: Retrieves top-K most similar results above threshold
- Context Augmentation: Adds retrieved context to the agent's prompt
- Response Generation: Agent generates response using retrieved context
Multiple Vectors
Agents can be configured with multiple vectors:
- Multiple Context Sources: Use different vectors for different types of context
- Combined Context: Combine context from multiple vectors
- Specialized Vectors: Use specialized vectors for specific domains
Configuring Vectors for AI Agents
Vector Selection
Select which vector(s) to use with the agent:
Field: Vector Configuration
How to configure:
- Navigate to AI Agent configuration
- Find the Vector Configuration section
- Select one or more vectors from the dropdown
- Each vector can have its own configuration
Considerations:
- Relevance: Choose vectors relevant to the agent's purpose
- Data Coverage: Ensure vectors contain data the agent needs
- Performance: Consider performance impact of multiple vectors
Search Parameters
Configure search parameters for each vector:
Top K
Set the number of results to retrieve from the vector.
Field: Top K
Range: 1 to 100
Default: 3
Recommendation:
- Start with 3-5 results
- Increase if agent needs more context
- Decrease if context is too verbose
Similarity Threshold
Set the minimum similarity score for retrieved results.
Field: Similarity Threshold
Range: 0.0 to 1.0
Default: 0.7
Recommendation:
- Higher threshold (0.7-0.9) for precise, relevant context
- Lower threshold (0.5-0.7) for broader context
- Adjust based on agent response quality
Data Source Filtering
Filter vector search to specific data sources:
Object Filtering
For Object vectors, filter to specific Objects:
Field: Objects Filter
How to configure:
- Select specific Objects from multi-select dropdown
- Only those Objects will be searched
- Useful when agent needs specific data subsets
Use Cases:
- Agent focused on specific business areas
- Limiting context to relevant Objects
- Improving search performance
File Filtering
For file vectors, filter to specific files:
Field: Files Filter
How to configure:
- Select specific files from multi-select dropdown
- Only those files will be searched
- Useful for document-specific agents
Use Cases:
- Agent focused on specific documents
- Limiting context to relevant files
- Document-based knowledge agents
Report Filtering
For report vectors, filter to specific reports:
Field: Reports Filter
How to configure:
- Select specific reports from multi-select dropdown
- Only those reports will be searched
- Useful for report-specific agents
Use Cases:
- Agent focused on specific report types
- Limiting context to relevant reports
- Report analysis agents
Vector Configuration Best Practices
Vector Selection
- Relevant Vectors: Choose vectors that contain relevant data
- Quality over Quantity: Fewer, high-quality vectors are better than many low-quality ones
- Domain Alignment: Ensure vectors align with agent's domain
- Data Freshness: Use vectors with up-to-date data
Parameter Tuning
- Start Conservative: Start with default parameters
- Test and Adjust: Test agent responses and adjust parameters
- Balance Context: Balance between too little and too much context
- Monitor Performance: Monitor agent performance and adjust accordingly
Filtering Strategy
- Use Filters When Needed: Filter when agent needs specific data subsets
- Avoid Over-Filtering: Don't filter too aggressively, may miss relevant context
- Test Without Filters: Test agent without filters first, then add if needed
- Document Filters: Document why filters are used
Agent Response Quality
Good Context Retrieval
Signs of good context retrieval:
- Relevant Responses: Agent provides relevant, accurate responses
- Uses Your Data: Responses reference your actual data
- Context-Aware: Agent understands context from your data
- Accurate Information: Information is accurate and up-to-date
Poor Context Retrieval
Signs of poor context retrieval:
- Irrelevant Responses: Agent provides irrelevant information
- Generic Responses: Responses don't use your data
- Outdated Information: Information is outdated or incorrect
- Missing Context: Agent lacks necessary context
Improving Context Retrieval
To improve context retrieval:
- Adjust Similarity Threshold: Lower threshold for more context, higher for more relevant
- Increase Top K: Retrieve more results for broader context
- Improve Vector Data: Ensure vectors contain relevant, high-quality data
- Use Filters: Filter to relevant data sources
- Test Different Vectors: Try different vectors or combinations
Use Cases
Customer Support Agent
Configure agent with customer data vector:
- Vector: Customer data vector with Objects (Customers, Orders, Products)
- Top K: 5-10 results
- Threshold: 0.7
- Use Case: Answer customer questions using actual customer data
Document Q&A Agent
Configure agent with document vector:
- Vector: Document vector with uploaded files
- Top K: 3-5 results
- Threshold: 0.8
- Use Case: Answer questions about documents
Workflow Assistant Agent
Configure agent with workflow vector:
- Vector: Workflow vector with MFlows
- Top K: 3-5 results
- Threshold: 0.7
- Use Case: Help users understand and use workflows
Related Introduction
- Vectors Introduction - Overview of vectors
- Creating Vectors - Learn how to create vectors
- Searching Vectors - Understand how to search vectors