Interfaces¶
See Interfaces for how to use each surface.
Command line¶
helioai.interfaces.cli ¶
Interactive CLI for HelioAI.
Usage
helioai # interactive readline session helioai "your query" # one-shot query helioai index # rebuild speasy catalog index helioai index --rebuild # force full reindex helioai export [id] # export a session as a reproducible .ipynb
main ¶
Entry point for the helioai command.
Routes subcommands (index, export, history, delete, profile, serve, ...) and otherwise runs either a one-shot query or the interactive prompt.
Source code in helioai/interfaces/cli.py
346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 | |
Jupyter magic¶
helioai.interfaces.jupyter_magic ¶
Jupyter IPython magics for HelioAI.
Load with
%load_ext helioai.interfaces.jupyter_magic
Cell magic
%%helioai solar wind density ACE 2005-01-17
Line magics
%helioai_session reset
%helioai_provider groq|gemini|azure
%helioai_history
%helioai_resume
HelioAIMagics ¶
Bases: Magics
IPython magics exposing the agent inside a notebook.
Source code in helioai/interfaces/jupyter_magic.py
219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 | |
helioai ¶
%%helioai — send a natural-language query to the agent.
Figures render inline; parameter cards and catalog previews render as HTML.
Example
%load_ext helioai.interfaces.jupyter_magic
%%helioai Download ACE IMF for the 2015-03-17 storm, plot Bz and mark the shock arrival.
Source code in helioai/interfaces/jupyter_magic.py
helioai_session ¶
%helioai_session [id] — show or switch the active session.
Source code in helioai/interfaces/jupyter_magic.py
helioai_provider ¶
%helioai_provider [name] — show or switch the LLM provider.
Source code in helioai/interfaces/jupyter_magic.py
helioai_history ¶
%helioai_history — list recent sessions.
Source code in helioai/interfaces/jupyter_magic.py
helioai_profile ¶
%helioai_profile — show or edit the user profile.
Source code in helioai/interfaces/jupyter_magic.py
helioai_export ¶
%helioai_export — export the session as a standalone notebook.
Source code in helioai/interfaces/jupyter_magic.py
helioai_resume ¶
%helioai_resume — pick a previous session to continue.
Source code in helioai/interfaces/jupyter_magic.py
helioai_dev ¶
%helioai_dev <token> — unlock unrestricted mode for this session.
Source code in helioai/interfaces/jupyter_magic.py
load_ipython_extension ¶
Web application¶
helioai.interfaces.web.app ¶
FastAPI web interface for HelioAI.
Single-user, no auth. Streams agent events as SSE.
Figures from the sandbox are served via /figure?path=
require_user
async
¶
Resolve the caller's user_id from the X-Helio-Token header.
No users configured (local dev) → single shared user, no auth. Once HELIOAI_USERS is set (deployment), a valid nominative token is required.
Source code in helioai/interfaces/web/app.py
index
async
¶
health
async
¶
chat_stream
async
¶
chat_stream(req: _ChatRequest, x_helio_dev_token: str | None = Header(default=None), user_id: str = Depends(require_user))
Stream one agent turn as Server-Sent Events.
Each agent event — tool calls, results, artifacts, sub-agent activity — is forwarded as it happens, which is what drives the live activity dock.
Source code in helioai/interfaces/web/app.py
list_sessions
async
¶
get_session_messages
async
¶
Replay a session: its messages plus any figures and figure reviews.
Source code in helioai/interfaces/web/app.py
145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 | |
get_profile
async
¶
Return the caller's profile markdown.
Source code in helioai/interfaces/web/app.py
put_profile
async
¶
Replace the caller's profile markdown.
Source code in helioai/interfaces/web/app.py
delete_session
async
¶
Delete one of the caller's sessions and its workspace.
Source code in helioai/interfaces/web/app.py
export_notebook
async
¶
Export a session as a standalone .ipynb and return it.
Source code in helioai/interfaces/web/app.py
serve_code
async
¶
Return a generated script, rewritten to standalone form.
Ownership is checked against the caller before anything is read, so a path outside the caller's workspace is a 404 rather than a leak.
Source code in helioai/interfaces/web/app.py
serve_figure
async
¶
Serve a figure (PNG or PDF) from the caller's workspace.
Source code in helioai/interfaces/web/app.py
serve_web ¶
Run the web UI with uvicorn.
Binds to localhost by default. The open-source build ships no authentication
and run_python executes model-written code, so do not expose this on a
network without putting auth in front of it.
Source code in helioai/interfaces/web/app.py
MCP server¶
helioai.mcp_server ¶
MCP server for HelioAI — exposes all registered tools via stdio or HTTP streamable transport.
Usage
helioai serve # stdio (Claude Desktop / claude CLI) helioai serve --http # HTTP streamable on 127.0.0.1:8765 helioai serve --http --host 0.0.0.0 --port 9000 helioai-mcp # direct entry point (stdio only)
serve_stdio
async
¶
Run the MCP server over stdio, for clients like Claude Desktop.
Blocks until the client closes the pipe. All 17 registry tools are exposed.
Example
Claude Desktop config: {"command": "helioai-mcp"} — stdio is the default transport, no flags needed.
Source code in helioai/mcp_server.py
build_http_app ¶
Build the streamable-HTTP ASGI app exposing the MCP server.
Returns a Starlette app mounting the MCP session manager at /mcp,
suitable for any ASGI server (serve_http wraps it in uvicorn).
Source code in helioai/mcp_server.py
serve_http ¶
Run the MCP server over streamable HTTP.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
host
|
str
|
Bind address. Anything but loopback logs a warning — |
required |
port
|
int
|
TCP port. |
required |
Source code in helioai/mcp_server.py
main ¶
Entry point for the helioai-mcp command.
Example
helioai-mcp # stdio (Claude Desktop, claude CLI) helioai-mcp --http --port 8765 # streamable HTTP on 127.0.0.1:8765
Source code in helioai/mcp_server.py
Indexer¶
helioai.indexer ¶
Build the speasy catalog ChromaDB index.
Usage
helioai index # incremental (skip existing) helioai index --rebuild # wipe and rebuild
build_index ¶
Walk the speasy inventory and index all parameters into ChromaDB.
Backs helioai index and must run once before search_parameters works;
the index persists under settings.rag.chroma_dir.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
rebuild
|
bool
|
Drop and re-create the collection instead of appending. |
False
|
batch_size
|
int
|
Documents per ChromaDB insert. |
128
|
verbose
|
bool
|
Print per-provider progress to stdout. |
True
|
Returns:
| Type | Description |
|---|---|
int
|
Number of parameters indexed (0 when speasy or chromadb is missing). |
Example
build_index(rebuild=True) # equivalent to: helioai index --rebuild 82433
Source code in helioai/indexer.py
163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 | |