What You’ll Build
A monitored AI research agent that:- Takes a user query
- Searches multiple sources
- Synthesizes findings
- Generates a report
Prerequisites
- Helicone API key (get one here)
- OpenAI API key
- Node.js 18+ or Python 3.8+
Step 1: Set Up Your Project
Step 2: Configure the Helicone Client
Step 3: Create Session Structure
Define your agent’s workflow hierarchy:Use descriptive paths that represent the type of work, not the order. Multiple requests can use the same path if they do the same conceptual task.
Step 4: Implement Agent Steps
1
Query Analysis
First, have the agent analyze the user’s query:
2
Search Multiple Sources
Perform searches for each identified topic:
3
Synthesize Results
Combine findings into coherent insights:
4
Generate Final Report
Create the final research report:
Step 5: Orchestrate the Agent
Put it all together:Step 6: View Results in Helicone
1
Navigate to Sessions
Go to Helicone Sessions in your dashboard.
2
Find Your Session
Filter by session name “Research Agent” or search for your session ID.
3
Analyze the Flow
You’ll see:
- Complete request hierarchy
- Duration of each step
- Costs per operation
- Total agent cost and latency
- Request/response details for debugging
Expected Output
After running the agent, you’ll see in Helicone:Best Practices
Troubleshooting
Sessions not appearing in dashboard
Sessions not appearing in dashboard
Check that:
- All three headers are present:
Helicone-Session-Id,Helicone-Session-Path,Helicone-Session-Name - Session ID is consistent across all requests
- Requests are successfully reaching Helicone (check response headers for
helicone-id)
Hierarchy not showing correctly
Hierarchy not showing correctly
- Paths must start with
/ - Use
/to separate levels:/parent/child - Ensure paths are consistent across related requests
Costs not calculating
Costs not calculating
Costs depend on accurate model detection. If using custom models or providers, costs may show as “not supported”. Contact help@helicone.ai to add support.
Next Steps
Sessions Documentation
Deep dive into session features and configuration
Custom Properties
Add metadata to track environments, users, and features
Cost Tracking
Monitor and optimize agent costs
User Metrics
Track agent usage per user