Why Use Sessions
Without sessions, you see individual requests in isolation:- ❌ Hard to trace which requests belong to the same workflow
- ❌ Can’t measure total cost or latency for a task
- ❌ Difficult to debug multi-step agent failures
- ❌ No visibility into request dependencies
- ✅ Group all related requests under one session ID
- ✅ Visualize parent-child relationships with path hierarchy
- ✅ Calculate total cost, latency, and token usage per session
- ✅ Debug agent workflows by tracing the entire execution flow
Quick Start
View in Dashboard
Visit helicone.ai/sessions to see your sessions:
- View all sessions grouped by name
- Click into a session to see the request hierarchy
- Analyze session-level metrics (cost, duration, request count)
- Filter by session name, date range, or properties
Session Components
Session ID
The unique identifier that groups requests together. Best Practices:- Use UUIDs for guaranteed uniqueness:
randomUUID() - Generate a new ID for each workflow instance
- Never reuse session IDs across different workflows
Session Path
Represents the hierarchical structure of your workflow. Path Rules:- Start with
/(forward slash) - Use
/to separate levels:/parent/child/grandchild - Group by function, not time
- Same conceptual work = same path
- Identify patterns (e.g., “all search operations are slow”)
- See when different phases occur in the workflow
- Compare durations across similar operations
Session Name
High-level grouping for filtering and organization. Best Practices:- Use descriptive names that describe the workflow type
- Keep the same name across all requests in the session
- Use session names to filter in the dashboard
Session Patterns
AI Agent Workflow
Track a multi-step agent that performs research and analysis:Multi-turn Chatbot
Track a conversation with multiple back-and-forth exchanges:Parallel Operations
Track multiple parallel operations in a workflow:Session Metrics
Helicone automatically calculates metrics for each session:- Total Cost: Sum of all request costs in the session
- Duration: Time from first to last request
- Request Count: Number of requests in the session
- Total Tokens: Combined prompt and completion tokens
- Average Latency: Mean latency across all requests
- Status: Success if all requests succeeded, otherwise failed
Querying Sessions
Retrieve session data via the REST API:Get All Sessions
Filter by Session Name
Get Session Metrics
Combining with Custom Properties
Add custom properties to session requests for richer filtering:Best Practices
Session ID Management
✅ Do:- Generate a new UUID for each workflow instance
- Store the session ID if you need to reference it later
- Use the same session ID for all related requests
- Reuse session IDs across different workflows
- Use predictable or sequential IDs
- Change session IDs mid-workflow
Path Structure
✅ Do:- Keep paths concise and descriptive
- Group by functionality, not by time
- Use consistent naming conventions
- Plan your hierarchy before implementing
- Use overly deep hierarchies (>5 levels)
- Include timestamps or IDs in paths
- Change path structure mid-session
- Use special characters or spaces
Session Names
✅ Do:- Use descriptive, human-readable names
- Keep the same name for similar workflows
- Use names that make filtering easy
- Include IDs or timestamps in names
- Use generic names like “Session” or “Request”
- Change names mid-workflow
Troubleshooting
Requests Not Grouping
Problem: Requests aren’t appearing in the same session. Solutions:- Verify all requests use the exact same session ID
- Check that session headers are included in every request
- Ensure session ID is a string, not an object
Missing Session Hierarchy
Problem: Session shows requests but not the tree structure. Solutions:- Verify all requests have the
Helicone-Session-Pathheader - Check that paths start with
/ - Ensure paths follow parent/child structure
Sessions Not Appearing in Dashboard
Problem: Sessions aren’t visible in the dashboard. Solutions:- Check that all three headers are included:
Helicone-Session-IdHelicone-Session-PathHelicone-Session-Name
- Verify requests are successfully logged (check Requests page)
- Wait a few seconds for data to propagate
Related Features
Requests
View individual requests within your sessions
Custom Properties
Add metadata to session requests for filtering
Traces
Log non-LLM operations within your sessions
Session API
Query sessions programmatically via REST API
Questions?
Need help or have questions? We’re here to help:- Discord Community: Join our Discord server for quick help
- GitHub Issues: Report bugs or request features on GitHub
- Documentation: Check our full documentation for more guides
