📡 Spellbook
A library of reusable agent “spells.” Supercharge your local AI with structured prompts, advanced automation routines, and repeatable workflow templates.
Overview
Spellbook is a prompt and automation library for the Companion Intelligence ecosystem. Think of it as a collection of reusable “spells” — structured prompt templates, multi-step agent workflows, and automation routines — that you can invoke to get consistent, high-quality outputs from your local LLMs.
Instead of writing the same prompts repeatedly or keeping them scattered in notes, Spellbook provides a centralized, versioned, shareable library that integrates directly with your Hub’s agent runtime.
Key Features
- Prompt library — organized collection of role-based and task-specific prompts
- Multi-step workflows — chain agent calls, tool invocations, and memory queries into repeatable sequences
- Variables & parameters — define inputs for each spell so they are reusable with different data
- Triggers — run spells on schedule, on Hub events, or via voice command
- Community spells — import spells from the CI Marketplace
- Version control — full history of every spell edit with rollback support
- MCP integration — expose spells as MCP tools callable by any connected agent
Use Cases
- Daily briefing spell: “Summarize my Digital Memory from yesterday, check the weather, list today’s tasks”
- Research spell: “Given this article [clip], write a structured summary with key points and counter-arguments”
- Meeting prep spell: “Review my memory for everything related to [project] in the past week”
- Code review spell: “Review this diff against our style guide and list issues by severity”
- Survival drill: scheduled weekly preparedness checklist (see Just In Case)
Spell Format
Spells are defined in YAML:
name: daily-briefing
description: Morning summary of memory, tasks, and schedule
version: 1.0.0
tags: [productivity, daily]
inputs:
- name: days_back
type: integer
default: 1
description: How many days of memory to summarize
steps:
- id: memory_summary
tool: digital_memory.search
params:
query: "activities and notes"
days: "{{inputs.days_back}}"
- id: briefing
tool: llm.complete
params:
model: default
prompt: |
Given the following memories from the past {{inputs.days_back}} day(s):
{{steps.memory_summary.result}}
Write a concise briefing covering:
1. Key activities and conversations
2. Open tasks or follow-ups
3. Anything that needs attention today
output: "{{steps.briefing.result}}"Setup
Install from Hub
Search for Spellbook in the Hub app store and install.
Open Spellbook
Navigate to http://spellbook.ci.localhost.
Import starter spells
On first launch, the Starter Pack wizard offers a curated set of commonly used spells. Select the ones you want and click Import.
Connect your LLM
In Settings → LLM, configure the default model endpoint (your Ollama or Open WebUI instance at http://ollama.ci.localhost).
Usage
Running a Spell
In the Spellbook UI, open any spell, fill in its inputs, and click Run. Output appears in the results panel.
Scheduling a Spell
Open a spell → Schedule → set a cron expression or natural language schedule (“every weekday at 8am”).
Exposing as MCP Tool
Open a spell → Settings → Expose as MCP Tool. The spell is now callable by any Companion Agent that has Spellbook’s MCP endpoint in its server list.
CLI Usage
ci-spellbook run daily-briefing --days-back 2
# List all spells
ci-spellbook list
# Import from Marketplace
ci-spellbook import marketplace://spellbook/research-assistantTroubleshooting
Spell produces inconsistent results
Add explicit formatting instructions and few-shot examples to the prompt step. Use temperature: 0.2 for deterministic tasks.
MCP tool not visible to agents
Check that Spellbook is running and the MCP endpoint (http://spellbook.ci.localhost/mcp) is configured in your agent’s MCP server list.
Scheduled spell not running Check the scheduler logs in Spellbook → Logs → Scheduler. Ensure the Hub’s timezone is configured correctly under Hub → Settings → System.