Documentation

Technical documentation for systemprompt.io - an embedded Rust library for building production AI infrastructure

systemprompt.io is an embedded Rust library for building production AI infrastructure. Clone the template, wrap your logic around it, and the CLI handles the rest—local development, cloud deployment, and everything in between.

Quick start:

# Clone the template
gh repo create my-ai --template systempromptio/systemprompt-template --clone

# Build
cargo build --release

# Run
just start

The same CLI that works locally also works in production. Your AI clients connect via MCP, your agents coordinate via A2A, and everything is authenticated and auditable out of the box.

Documentation Sections

Section Purpose Key Code
Getting Started Install, first agent, playbooks src/main.rs, src/lib.rs
Config Profiles, database, secrets .systemprompt/profiles/*/profile.yaml
Services Agents, MCP, AI providers services/, extensions/web/src/config_loader.rs
Extensions Custom Rust code extensions/web/src/extension.rs
Cloud Deploy, sync, domains extensions/mcp/systemprompt/src/cli.rs

Getting Started

The CLI binary is the primary interface. On startup, src/main.rs:6 calls __force_extension_link() which references each extension's PREFIX constant - this prevents the linker from stripping extensions during LTO optimization. The cli::run() function then initializes the library with all registered extensions.

  • Installation - Install via cargo install systemprompt or build from source
  • Licensing - BSL-1.1 license, pricing model, and what you can build
  • Playbooks - Machine-readable instruction sets that guide both users and AI agents

Code:

Playbooks:


Config

The .systemprompt/ directory contains deployment and environment configuration, kept separate from runtime services. Profiles define database connections, server settings, JWT secrets, and cloud credentials. The ProfileBootstrap::init() function in the MCP server entry point loads the active profile, followed by SecretsBootstrap::init() for credentials and Config::init() for service configuration.

  • Config Overview - Directory structure and configuration flow
  • Profiles - Environment-specific settings (local, staging, production)
  • Database - PostgreSQL setup options (cloud, local, Docker, managed)
  • Secrets - API keys and credentials (gitignored)

Code:

Playbooks:


Services

The services/ directory contains YAML configuration for all runtime components. No Rust code lives here - only configuration files and Markdown content. The config_loader.rs module loads navigation from services/web/config/navigation.yaml, homepage sections from homepage.yaml, and feature pages from features/*.yaml. Services are hot-reloadable: edit YAML, sync to database, changes take effect without restart.

  • Services Overview - All service types and directory structure
  • Agents - A2A protocol cards and skill assignments
  • MCP - Tool server hosting with OAuth scopes
  • AI - Provider configuration (Anthropic, OpenAI, Gemini)
  • Content - Blog posts, documentation, content indexing
  • Scheduler - Background jobs with cron scheduling
  • Web - Branding, navigation, theme configuration

Code:

Playbooks:


Extensions

Extensions add custom functionality via Rust code in extensions/. The library uses the inventory crate for compile-time registration - call register_extension!(MyExtension) and your extension is automatically discovered at startup. The Extension trait defines hooks for page data providers, component renderers, database schemas, API routes, background jobs, and required assets.

Code:

  • extensions/web/src/extension.rs:39-280 - Full extension implementation:
    • Line 90: impl Extension for WebExtension
    • Line 99: page_data_providers() - Navigation and homepage data
    • Line 138: schemas() - Database migrations
    • Line 155: router() - API routes under /api/v1/
    • Line 165: jobs() - Scheduler jobs like content ingestion
    • Line 185: required_assets() - CSS/JS files to publish
    • Line 280: register_extension!(WebExtension) - Inventory registration
  • src/lib.rs:19-20 - __force_extension_link() prevents LTO from stripping extensions
  • extensions/mcp/systemprompt/manifest.yaml:1-9 - MCP server manifest with binary name and port

Playbooks:


Cloud

systemprompt.io Cloud provides managed infrastructure for production deployments. The cloud configuration in profile.yaml defines credentials_path and tenants_path for authentication. The cli.rs module executes CLI commands with the auth token injected via environment variables (SYSTEMPROMPT_AUTH_TOKEN), enabling secure cloud operations from MCP servers.

  • Configuration Overview - Features, free vs paid, architecture diagram
  • Deployment - One-command deploy with CI/CD integration
  • Sync - Push/pull configuration between local and cloud
  • Domains - Custom domains with automatic TLS via Let's Encrypt
  • Secrets - Cloud credential management and rotation

Code:

Playbooks:


External Resources