Skip to main content

Agents

app.routers.agents

list_projects

def list_projects()

list_conversations

def list_conversations(project: str | None = Query(None))

get_conversation

def get_conversation(conversation_id: str, project: str | None = Query(None))

list_subagents

def list_subagents(conversation_id: str, project: str | None = Query(None))

get_subagent

def get_subagent(conversation_id: str, subagent_id: str, project: str | None = Query(None))

model_usage

def model_usage(project: str | None = Query(None), conversation_id: str | None = Query(None))

Aggregate Cursor model usage for a project (or a single conversation).

Joins two Cursor stores that live outside the agent-transcripts directory: ~/.cursor/chats/<workspace_hash>/<agent_id>/store.db for per-agent metadata, and ~/.cursor/ai-tracking/ai-code-tracking.db for code-hash aggregates. The workspace hash is derived from the project slug (md5 of the absolute repo path), so this only resolves when a project is selected; when DGX_LAB_AGENT_TRANSCRIPTS_DIR is overridden we still return global tracking totals so the UI has something to show.

get_stats

def get_stats(project: str | None = Query(None))