GET /api/research//stream
Stream research results in real-time using Server-Sent Events (SSE). This endpoint spawns research agents and streams their findings as they arrive.Authentication
No authentication required (for hackathon demo).Path Parameters
Person’s full name to research.
Query Parameters
Optional photo URL to associate with the person record.
Response
Server-Sent Events stream with the following event types:Event: init
Sent immediately upon connection.
Created person record ID (or
null if Convex unavailable).Echo of the person name being researched.
Echo of the provided image URL.
Browser Use session ID for live view (initially
null, updated in background).Browser Use live session URL (initially
null, updated in background).Event: result
Sent for each research agent that completes.
Name of the research agent (e.g., “exa_fast_pass”, “linkedin_agent”).
Array of text snippets extracted by the agent.
Array of relevant URLs discovered.
Agent’s confidence in the results (0.0 to 1.0).
Time taken by the agent in milliseconds.
Event: dossier
Sent once after synthesis completes.
Executive summary.
Current job title.
Current employer.
Work experience array.
Education background.
Social media links.
Notable achievements.
Suggested conversation topics.
Potential concerns.
Event: complete
Sent when all agents finish and synthesis completes.
Final person record ID.
Number of research agents that completed.
Total URLs discovered across all agents.
Example Request (JavaScript)
Example Request (curl)
Example Response Stream
Status Codes
- 200 - Stream established (keep connection open to receive events)
- 503 - Browser Use API key not configured
- 500 - Server error during research initialization
Research Agents
The following agents run in parallel:- exa_fast_pass - Exa API for quick background search (2-5s)
- linkedin_agent - Browser Use agent scraping LinkedIn (10-30s)
- twitter_agent - Browser Use agent scraping Twitter/X (10-30s)
- google_agent - Browser Use agent scraping Google results (5-15s)
- crunchbase_agent - Browser Use agent for corporate data (15-45s)
Performance
- First result: 2-5 seconds (Exa fast-pass)
- Most results: 10-30 seconds
- Full completion: 30-60 seconds
- Synthesis: Additional 5-10 seconds
Best Practices
Keep connection open until
complete eventHandle reconnection with exponential backoff
Display partial results as they arrive for better UX
POST /api/agents/research
Start research agents for a person (returns immediately without waiting).Request
Existing person record ID.
Person’s full name.
Array of source types to research. Available sources:
linkedin- LinkedIn profile and activitytwitter- Twitter/X profile and tweetsgoogle- Google search resultscrunchbase- Crunchbase company/person data
Response
Echo of the person ID.
Array of spawned agent sessions.
Example Request
Example Response
Status Codes
- 200 - Agents started successfully
- 400 - Invalid request (missing fields or unknown sources)
- 503 - Browser Use API not configured
- 500 - Server error starting agents
GET /api/agents/sessions/
Get status and results for a research agent session.Path Parameters
Browser Use session ID from
/api/agents/research response.Response
Echo of the session ID.
Current status:
pending, running, completed, or failed.URL to watch the agent live (only available while running).
URL to replay the session (only available after completion).
Task execution details.
Example Request
Example Response
Status Codes
- 200 - Session status retrieved
- 404 - Session not found
- 500 - Server error retrieving session