Security advisory — Malicious litellm versions 1.82.7 and 1.82.8 were removed from PyPI (potential API key exfiltration). Uninstall them, rotate exposed credentials, and upgrade to a safe release (e.g. 1.82.9+). Run pip show litellm to verify. PyPI · README

Studio Server

Studio server and session management.

Studio Server & Session Management

Studio is the FastAPI process Near talks to. It is created by create_studio_app() in agenticx/studio/server.py. Chat turns are text/event-stream JSON frames, not a blocking request/response of the full answer.

agx serve starts this HTTP API. agx studio starts the terminal REPL. They are different commands.

Diagram: Near renderer ↔ Electron ↔ Studio FastAPI ↔ AgentRuntime SSE.

Starting the Server

bash
1agx serve --host 127.0.0.1 --port 8000
SettingDefaultDescription
Host0.0.0.0Listen address
Port8000Listen port
--reloadFalseDevelopment mode hot reload

Session Management

ManagedSession fields

FieldDescription
session_idStable UUID string
studio_sessionStudioSession holding provider/model, chat history
confirm_gateAsyncConfirmGate for the Meta-Agent
team_managerAgentTeamManager for sub-agents
avatar_id / avatar_nameOptional avatar binding
session_nameUser-visible title
pinnedBoolean for ordering
archivedBoolean for visibility

Persistence layout

StoreRole
SessionStore (SQLite)Todos, scratchpad, metadata
messages.jsonFull chat history snapshot
agent_messages.jsonLast 40 agent-context messages

API Reference

Chat & execution

RouteMethodDescription
/api/chatPOSTMain chat turn; returns SSE stream
/api/confirmPOSTResolve pending confirmation

Session management

RouteMethodDescription
/api/sessionGETGet or create session
/api/sessionDELETEDelete session
/api/sessionsGETList sessions
/api/sessions/{id}/forkPOSTFork session

Avatar & group

RouteMethodDescription
/api/avatarsGET/POSTList or create avatars
/api/groupsGET/POSTList or create group chats
/api/subagent/cancelPOSTCancel running sub-agent

SSE Streaming Protocol

Endpoint: POST /api/chat

Response: Content-Type: text/event-stream

Each JSON object follows the SseEvent model:

json
1{"type": "<event_type>", "data": { "...": "..." }}

Every stream ends with a done sentinel:

json
1{"type": "done", "data": {}}

Workspace Context

Meta-Agent system prompts incorporate files under ~/.agenticx/workspace/:

KeySource file
identityIDENTITY.md
userUSER.md
soulSOUL.md
memoryMEMORY.md
daily_memorymemory/<YYYY-MM-DD>.md