Overview
This page documents the data flow patterns and request/response sequences in Pricing Intelligence, showing how different components interact to process user queries.Core Data Flow Patterns
1. Simple Query Flow
The most basic interaction: user asks a question about a known pricing URL.Detailed Flow Scenarios
Scenario A: First-Time URL Analysis
User asks about a pricing URL that hasn’t been cached.Flow Diagram
Key Points:- Cache Miss: First request triggers full extraction pipeline
- A-MINT Processing: ~5-10 seconds for LLM extraction
- Caching: YAML cached for 1 hour to avoid re-extraction
- Summary Calculation: Fast in-memory statistics (~100ms)
Scenario B: Cached URL with Filters
User asks about a previously analyzed URL with specific requirements.Flow Diagram
Performance:- Cache Hit: YAML retrieval ~1ms
- DZN Conversion: ~200ms
- MiniZinc Solving: ~500ms for small models
- Total Time: ~700ms (vs 5-10s without cache)
Scenario C: Optimization Query
Finding the cheapest or most expensive plan.Flow Diagram
Optimization Details:- Constraint Variables: Plan selection, add-on selections
- Objective Function:
minimize(plan_cost + sum(addon_costs)) - Constraints: Feature requirements, usage limit thresholds
- Solver: MiniZinc with Chuffed backend (default)
Scenario D: Multi-Pricing Comparison
Comparing pricing models across different SaaS providers.Flow Diagram
Harvey performs per-context grounding - it identifies that HubSpot uses “SSO” while Salesforce uses “Single Sign-On” by analyzing each YAML schema independently.
Request/Response Patterns
Pattern 1: Synchronous Summary
Use Case: Quick statistics about a pricing model- Latency: ~100-200ms
- Operation: In-memory YAML parsing and statistics
- No solver required
Pattern 2: Asynchronous Job Processing
Use Case: Complex CSP operations (optimal, subscriptions, validate) Characteristics:- Latency: 500ms to 60s depending on complexity
- Polling Interval: Recommended 1-2 seconds
- Job TTL: Results cached for 1 hour
Pattern 3: Streaming Chat Response
Harvey streams responses to the frontend using Server-Sent Events.Caching Strategy
Cache Layers
MCP Server Cache
Key:
pricing:{url}Value: Pricing2Yaml contentTTL: 3600 seconds (1 hour)Backend: In-memory or RedisAnalysis API Job Cache
Key:
job:{jobId}Value: Job status and resultsTTL: 3600 secondsBackend: In-memory MapCache Hit/Miss Flow
Cache Invalidation
- Manual: Set
refresh: truein tool call - TTL Expiration: Automatic after 1 hour
- No Proactive Invalidation: System doesn’t monitor URLs for changes
Error Handling Patterns
Error Propagation
Common Error Scenarios
Invalid URL
Invalid URL
Trigger: User provides malformed or inaccessible URLError:
AMintError: Failed to fetch URLHandling: Harvey asks user to verify URLLLM Extraction Failure
LLM Extraction Failure
Trigger: A-MINT can’t extract pricing structureError:
AMintError: No pricing data foundHandling: Harvey suggests manual YAML uploadInvalid Filter
Invalid Filter
Trigger: Filter references non-existent featureError:
AnalysisError: Feature 'XYZ' not found in YAMLHandling: Harvey re-plans with corrected feature namesUnsatisfiable Constraints
Unsatisfiable Constraints
Trigger: No plan satisfies the filter criteriaError:
AnalysisError: No solution foundHandling: Harvey explains why no plan matchesSolver Timeout
Solver Timeout
Trigger: CSP problem too complexError:
AnalysisError: Solver timeout after 60sHandling: Harvey suggests simplifying filters or using Choco solverPerformance Metrics
Latency Breakdown
| Operation | Cold (Cache Miss) | Warm (Cache Hit) |
|---|---|---|
| iPricing | 5,000-10,000ms | 1-5ms |
| Summary | 100-200ms | 100-200ms |
| Subscriptions (small) | 500-1,000ms | 500-1,000ms |
| Subscriptions (large) | 5,000-60,000ms | 5,000-60,000ms |
| Optimal | 500-2,000ms | 500-2,000ms |
| Validate | 300-800ms | 300-800ms |
Throughput
- Harvey API: ~10 concurrent chat sessions
- MCP Server: ~50 concurrent tool calls
- Analysis API: ~20 concurrent jobs
- A-MINT API: ~5 concurrent extractions (LLM rate limit)
Next Steps
Architecture Overview
Return to architecture overview
Service Details
Explore individual services