Workflows
Beyond freeform chat, the agent-service exposes task-shaped runs: a generic agent/runs entry point and named graph/* workflows. All stream SSE except multi-persona analysis, which returns JSON.
Generic agent run
POST /api/agent/runs runs any registered task and streams it.
{
"taskType": "analyze",
"payload": { "resumeData": { "basics": { "name": "Ada" } } },
"config": { "model": "gpt-4o-mini" }
}| Field | Type | Notes |
|---|---|---|
taskType | string | The task to run (e.g. research, analyze, rewrite) |
payload | object | Task-specific input |
config | object | LLM/model overrides |
Streams the same event types as chat (run_started → message_chunk → run_completed → done). The runId is persisted.
Inspect a run afterward
| Action | Method & path |
|---|---|
| Get run metadata | GET /api/agent/runs/:runId |
| Get run events | GET /api/agent/runs/:runId/events |
curl http://localhost:3112/api/agent/runs/clx123/events | jqGraph workflows
Named workflows under /api/graph/*. Each takes a JSON body (commonly { resumeData, config, language }) and streams SSE.
| Workflow | Endpoint | Purpose |
|---|---|---|
| Research | POST /api/graph/research | Gather job-market / role context |
| Analyze | POST /api/graph/analyze | Critique a resume (alias: POST /api/graph/analyze-resume) |
| Rewrite | POST /api/graph/rewrite | Rewrite / improve resume content |
Analyze
curl -N -X POST http://localhost:3112/api/graph/analyze \
-H "Content-Type: application/json" \
-d '{ "resumeData": { "basics": { "name": "Ada" }, "work": [] }, "language": "en" }'Watch for critique, suggestion, and resume_analysis events alongside message_chunk.
Multi-persona analysis (JSON)
POST /api/graph/analyze-resume-multi runs several reviewer personas and returns a single JSON result (not a stream).
{
"resumeData": { "basics": { "name": "Ada" }, "work": [] },
"config": {},
"language": "en"
}It accepts resumeData (or resume), an optional config, and language (defaults to en). Because it’s not SSE, just await res.json() and read data.
taskType for agent/runs and the graph/* workflows share the same underlying task engine — /api/graph/analyze is effectively agent/runs with taskType: "analyze" and a legacy-friendly path. Use whichever fits your integration.