Skip to content

Latest commit

History

10 Commits

Folders and files

NameName
Last commit message
Last commit date

Repository files navigation

slater

A Fact-governed agent framework for building deterministic and auditable autonomous systems.

Overview

Slater is a Python framework for building state-driven AI agents whose behavior is:

  • Deterministic — Given the same facts, agents always make the same transitions
  • Inspectable — Every decision is traceable to explicit rules and facts
  • Replayable — Complete iteration history enables post-run debugging
  • Explainable — Agent behavior is specified declaratively before execution

Instead of writing imperative loops that decide "what to do next," you describe the structure of an agent via an AgentSpec, and Slater executes that structure safely.

Features

Declarative Agent Specification

Bundle your agent's complete behavior into a single, validated AgentSpec:

fromslater.phasesimportPhaseEnum, PhaseRulefromslater.policiesimportControlPolicy, TransitionPolicyfromslater.proceduresimportProcedureTemplatefromslater.specimportAgentSpecPhase=PhaseEnum.create("START", "PROCESSING", "DONE")
spec=AgentSpec(
name="my-agent",
version="1.0.0",
phases=set(Phase),
control_policy=ControlPolicy(...),
transition_policy=TransitionPolicy(rules=[...], default=Phase.START),
procedures={Phase.START: ProcedureTemplate(...), ...},
)

Dynamic Phase Enums

Define agent-specific phases with validation:

fromslater.phasesimportPhaseEnum# Names must be UPPER_SNAKE_CASE, no reserved wordsPhase=PhaseEnum.create(
"NEEDS_CONTEXT",
"READY_TO_CONTINUE",
"TASK_COMPLETE",
)

Fact-Based State Management

Facts are typed, scoped, and flow through the system with clear semantics:

ScopeVisibilityPersistence
iterationCurrent iteration onlyNot persisted
sessionAll iterationsAgent lifetime
persistentAll iterationsAcross restarts

FSM Safety

  • Cycle detection — Agents fail fast if stuck in the same phase
  • Rule validation — Overlapping PhaseRules caught at construction time
  • Deterministic transitions — Phase changes derived only from durable facts

Complete Audit Trail

Two-file persistence pattern:

  • {agent_id}.json — Current state snapshot
  • {agent_id}_history.jsonl — Append-only iteration log

Core Concepts

ConceptPurpose
PhaseWhere the agent is in its lifecycle
FactA typed piece of knowledge emitted by Actions
ActionA unit of work that reads state and emits Facts
ProcedureA sequence of Actions executed for a Phase
PhaseRuleDeclares when to transition between Phases
ControlPolicyGlobal constraints (completion, failure, pause)
TransitionPolicyRules for FSM progression
AgentSpecThe complete, validated agent definition

Local Development

Prerequisites

  • Python 3.10+
  • uv (installed automatically by Makefile)

Setup

# Create virtual environment and install dependencies
make venv
# Activate the environmentsource .venv/bin/activate

Running Tests

# Run all tests
make tests
# Run unit tests only
make unit-tests
# Run integration tests only
make integration-tests

Other Commands

# Show available commands
make help# Export dependencies to requirements.txt
make requirements
# Clean build artifacts
make clean

Project Structure

slater/
├── slater/ # Main package
│ ├── __main__.py # CLI entrypoint
│ ├── controller.py # AgentController (execution engine)
│ ├── phases.py # PhaseEnum factory, PhaseRule
│ ├── policies.py # ControlPolicy, TransitionPolicy
│ ├── procedures.py # ProcedureTemplate
│ ├── spec.py # AgentSpec (declarative specification)
│ ├── state.py # StateStore implementations
│ └── types.py # Fact, Facts, core types
├── tests/
│ ├── unit/ # Unit tests
│ └── integration/ # Integration tests
├── docs/ # Documentation
│ ├── adr/ # Architecture Decision Records
│ └── user-guide.md
├── pyproject.toml
├── Makefile
└── README.md

Documentation

License

MIT

About

an actionpacked framework for deterministic, agentic workflows

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages