<a href="https://pypi.org/project/spice-runtime/"><img src="https://img.shields.io/pypi/v/spice-runtime" alt="PyPI"></a>
<img src="https://img.shields.io/badge/python-≥3.11-blue" alt="Python">
<img src="https://img.shields.io/badge/license-MIT-green" alt="License">
<a href="https://discord.gg/DajVWWNMfE"><img src="https://img.shields.io/badge/Discord-Community-5865F2?style=flat&logo=discord&logoColor=white" alt="Discord"></a>
Agents can execute.
But they don’t know what to do next.
Spice is a decision-layer runtime — a brain above agents. inspired by the rise of execution agents like OpenClaw and the idea of world model.
While execution agents (Claude Code, OpenClaw, Codex) are getting better at doing things,
Spice focuses on the missing layer:
👉 What should be done next — and why.
Today, we have powerful agents that can do almost anything:
But when you sit down to use them, you still face the same problem:
What should I do next?
That’s the hard part.
The real bottleneck is:
Decision-making.
Spice is designed to solve that.
Spice provides a structured cognitive loop inspired by the concept of world model :
perception → state model → simulation → decision → execution → reflection
It allows AI systems to:
Spice is a general decision runtime. —
To make this concrete, we built our first reference application:
It is not just a demo.
It is an AI that helps you:
From:
question → reasoning → decision → action → outcome
All in one loop.
"I want to quickly build a lightweight tool for a small group of friends."
A simple, real-world goal with clear constraints

starts from intent

From options → structured decision space

Decision becomes action
Spice focuses on the decision layer.
In a full workflow, the selected decision can be passed to external agents (e.g. codex and claude code) for execution.
This example stops at decision + next step.
➡️ Next, we will take this exact scenario and connect it to an external agent to actually build the tool end-to-end.
Decision → Execution → Outcome → Reflection
This is the full loop Spice is designed to enable.
Spice Personal is just one reference.
The underlying model is domain-agnostic.
Spice is a general decision runtime that can be applied to any domain where:
This includes:
Spice is not limited to one use case.
It is a foundation for building decision systems.

Install from source (latest features, for development)
git clone https://github.com/Dyalwayshappy/Spice.git
cd Spice
python -m venv .venv
source .venv/bin/activate # Windows: .venv\Scripts\activate
pip install -U pip
pip install -e .
Install from PyPI (stable, recommended)
pip install spice-runtime
pip install -U spice-runtime
spice-runtime --version
Spice is a decision-layer runtime.
The easiest way to try Spice is through the reference application: Spice Personal.
spice-personal init
This creates a local workspace at:
.spice/personal/ and generates a default configuration file.
spice-personal ask "What should I do next?"
Since no model is configured yet, Spice will guide you with a structured Decision Card:
This helps you understand the next step instead of failing silently.
Edit the generated config file:
.spice/personal/personal.config.json
Configure your model provider (e.g. OpenRouter) and set your API key:
export OPENROUTER_API_KEY=...
spice-personal ask "your intent"
Now Spice will produce a real decision, not just a setup guide.
spice-personal session
Spice can delegate actions to external agents (e.g. Claude Code, Codex).
This enables:
To enable this, configure your agent in:
.spice/personal/personal.config.json
This is where Spice moves beyond reasoning — into action.
Now Spice can:
search for relevant information
call external tools(Currently supports wrappers for CodeX and ClaudeCode.)
and make decisions grounded in real-world signals
Spice transforms your world into a structured decision system.
It enables a new way to think, decide, and act:
Perception
Understand your world and extract meaningful signals
State Modeling
Turn it into a structured decision model
Simulation
Explore possible futures before taking action
Decision
Compare trade-offs and then give you decision-making assistance.
Execution (optional)
Delegate actions to external agents (e.g. Claude Code, Codex)
Reflection
Learn from outcomes and continuously improve decisions
SDEP is the protocol defined by Spice for connecting the decision layer with external execution agents.
Spice decides what should be done.
SDEP handles how that decision is executed and how results flow back.
Most AI systems tightly couple reasoning and execution.
SDEP introduces a clean separation:
Decision layer (Spice) → determines intent and direction
Execution layer (agents/tools) → performs real-world actions
This allows Spice to act as a brain above agents, instead of being tied to any single tool.
SDEP is responsible for:
Encoding execution intent
Turning decisions into structured, executable requests
Dispatching to external agents
(CLI tools, subprocesses, remote services, etc.)
Receiving structured results
Capturing outputs, status, and signals from execution
Feeding outcomes back into the system
Enabling state updates, reflection, and next decisions
Decision → ExecutionIntent → Agent → Result → Outcome → Reflection
Spice is not an execution agent.
It is the decision layer above agents.
Spice supports an open wrapper ecosystem.
Even if an external agent does not natively support SDEP, it can still be integrated through a wrapper.
A wrapper is a protocol bridge between Spice and external agents.
Spice (SDEP) ↔ Wrapper ↔ External Agent
SDEP is a newly launched protocol that connects the decision layer with external execution agents; its ecosystem still needs development.
Wrappers make Spice immediately compatible with the existing ecosystem:
Wrappers exist to make Spice useful today.
They allow us to integrate with existing agents without requiring changes.
But we believe this is a transitional layer.
In the long term, we expect more agents to adopt SDEP natively —
enabling a clean, direct connection between decision systems and execution.
Wrappers make Spice practical.
SDEP is where the real value compounds.
spice/
├── spice/ # 🧠 Core decision runtime framework
│ ├── core/ # Runtime loop + state store
│ ├── protocols/ # Observation/Decision/Execution contracts
│ ├── decision/ # Decision policy primitives
│ ├── domain/ # DomainPack abstractions
│ ├── domain_starter/ # New-domain scaffold templates
│ ├── executors/ # Executor interface + SDEP adapter
│ ├── llm/ # Optional LLM core/adapters/providers
│ ├── memory/ # Context/memory components
│ ├── replay/ # Replay utilities
│ ├── shadow/ # Shadow-run evaluation
│ ├── evaluation/ # Eval helpers
│ ├── entry/ # Core CLI/tooling (quickstart/init domain)
│ └── adapters/ # External system adapters
├── tests/ # ✅ Core test suite
├── docs/ # 📚 Architecture + protocol docs (incl. SDEP)
├── examples/ # 🧪 Runtime and SDEP examples
├── pyproject.toml # 📦 spice-runtime package metadata
├── README.md # 📝 Core project overview
├── LICENSE # ⚖️ MIT
└── .gitignore # 🙈 Ignore rules
Spice is an evolving decision-layer system.
We’ve built the core runtime, personal reference app, and SDEP-based execution loop.
Next, we focus on expanding capabilities and ecosystem.
PRs are welcome — the system is designed to be modular and extensible.
[ ] Richer decision modeling
Better simulation, trade-off analysis, and multi-step reasoning
[ ] Stronger memory layer
Long-term state, context compression, and memory providers
[ ] More execution integrations
Expand agent ecosystem (CLI, APIs, tools, services)
[ ] Multi-step decision workflows
From single decisions → structured plans and execution chains
[ ] Better observability
Inspect decisions, execution traces, and state transitions
[ ] Domain expansion
Apply Spice to new domains beyond personal (software, ops, research)
[ ] Native SDEP ecosystem
More agents supporting SDEP directly (less reliance on wrappers)
[ ] Persistent decision systems
Systems that continuously learn and evolve over time
We believe the future of AI is not just execution —
but better ways to think and decide.
Spice is an attempt to build a new layer in the AI stack:
a decision layer above agents.
Our goal is simple:
Everyone should have a Spice.
A system that:
Not just a tool.
Not just a chatbot.
But a personal decision brain
that evolves with you over time.
We are still early.
But we believe this direction leads to:
Spice is not just an assistant.
It is a step toward a decision brain for everyone.
<source media="(prefers-color-scheme: light)" srcset="https://api.star-history.com/svg?
$ claude mcp add Spice \
-- python -m otcore.mcp_server <graph>