Skip to main content

Overview

The searchChatHistory tool transforms your agent executions into a queryable data warehouse. Every agent run creates a permanent record that can be analyzed, aggregated, and reported on by other agents.

How Search-Chat-History Works

Technical Implementation

Search Capabilities

  1. Full-text search across all agent outputs
  2. Semantic matching - finds conceptually related content
  3. Time-based filtering - recent vs relevant sorting
  4. Execution context - can filter by specific scheduler IDs
  5. Multi-format - searches both messages and documents

KPI Monitoring Patterns

Pattern 1: Daily Aggregation

Pattern 2: Exception Monitoring

Pattern 3: Performance Benchmarking

Advanced Search Strategies

1. Structured Output Parsing

Train your agents to output structured data for easier parsing:

2. Tag-Based Organization

Use consistent tags for categorization:

3. Hierarchical Reporting

Build reporting chains that progressively summarize:

Real-World KPI Monitoring Examples

Example 1: E-commerce Operations Dashboard

Example 2: Sales Team Performance Tracking

Example 3: DevOps Monitoring Chain

Building Effective KPI Search Queries

Query Construction Tips

  1. Be Specific with Agent Names
  2. Use Consistent Terminology
  3. Include Time Markers
  4. Leverage Natural Language

Visualization and Reporting

Creating Report Agents

Integration with BI Tools

Performance Optimization

1. Search Query Optimization

  • Use specific agent names to narrow search scope
  • Leverage time-based sorting for recent data
  • Limit result size when only need latest values

2. Data Structure Standardization

3. Caching Strategies

Best Practices

  1. Consistent Naming Convention
    • Use descriptive agent names: region-west-sales-tracker
    • Include metric type in output: METRIC:revenue VALUE:12000
  2. Time Window Management
    • Always include timestamps in outputs
    • Use consistent time zones (UTC recommended)
    • Plan for time-based aggregations
  3. Error Handling
    • Log both successes and failures
    • Include error context for debugging
    • Build separate error-monitoring agents
  4. Data Retention
    • Consider search performance vs history depth
    • Archive old data before deletion
    • Plan for compliance requirements

Need help setting up KPI monitoring? Check our agent creation guide or contact support.