starflask
Rust SDK for the Starflask AI agent platform.
Installation
[]
= "0.1"
Quick start
use Starflask;
async
Query
Send a chat message to an agent and wait for the response. The SDK handles session creation and polling automatically.
// Simple query — uses the agent's soul prompt
let session = sf.query.await?;
println!;
// Query with a specific persona
let session = sf.query_with_persona.await?;
When you specify a persona, the agent's soul prompt is still used as the base system context, but the named persona's prompt is appended — giving the agent a specific behavioral mode for that query.
Hooks
For structured workflows where an agent pack defines event-specific persona templates with variable substitution, use hooks:
// Fire and wait
let session = sf.fire_hook_and_wait.await?;
// Fire without waiting
let session = sf.fire_hook.await?;
Packs
Packs define an agent's soul, personas, and hooks. Use provision_pack to create and install a pack in one step.
let result = sf.provision_pack.await?;
println!;
Provisioning is idempotent — calling it again with the same content is a no-op (matched by content_hash). Calling it with updated content replaces the agent's existing pack.
If you already have a content_hash from a previous provision, you can install it directly:
sf.install_agent_pack.await?;
Features
- Agents — create, list, update, activate/deactivate, and delete agents
- Query — send messages to agents with automatic session polling, optional persona selection
- Hooks — fire hook events with payload variable substitution
- Sessions — list and inspect session history
- Packs — install and provision agent packs
- Integrations — manage platform integrations (Discord, etc.)
- Tasks — create and list scheduled agent tasks
- Memories — list agent memories
Custom base URL
let sf = new?;
License
MIT