from solidstate import AgentRuntime, RuntimeState
from solidstate.models.openai_model import OpenAIModelAdapter
from solidstate.persistence import FileCheckpointer
# Initialize runtime with model, checkpointer, and policies
runtime = AgentRuntime(
model=OpenAIModelAdapter("gpt-4o"),
tool_registry=registry,
policy_evaluator=policy,
checkpointer=FileCheckpointer("checkpoints/"),
tracer=JsonlTracer("audit.jsonl")
)
# Run turn-based execution loop
state = RuntimeState.new("Analyze account risk and transfer funds")
final_state = await runtime.run(state)
print(f"Final execution status: {final_state.status}")from solidstate.graph import StateGraph
from solidstate import RuntimeState
# Construct multi-agent orchestration graph
workflow = StateGraph()
workflow.add_node("researcher", researcher_agent.run)
workflow.add_node("writer", writer_agent.run)
workflow.set_entry_point("researcher")
workflow.add_edge("researcher", "writer")
# Alternatively, build workflow using symbolic syntax sugar:
# pipeline = researcher >> writer
pipeline = researcher >> writer
final_state = await pipeline.run(state)The Five Pillars of SolidState
Exposing the raw mechanics required to transition agents from simple loops to production applications.
State Management
Every conversation turn, model decision, and tool input is logged and versioned in a structured state context.
Tool Governance
Every generated action is parsed and verified by a deterministic schema and security policy before running.
Human-in-the-Loop
Seamlessly pause execution on high-risk operations, request human approval, and resume from checkpoints.
Checkpoint Persistence
Save and recover agent states automatically. Supports local filesystem, Redis caching, or Amazon DynamoDB tables.
Multi-Agent Graphs
Orchestrate specialized agent handoffs and conditional routing using StateGraphs and symbolic chaining (`>>`).
Framework Modules
A modular design enabling custom storage, model adapters, and visual debug dashboards.
solidstate-core
The lightweight state machine runtime loop in Python. Handles context trimming, introspects Pydantic classes for schemas, supports concurrent tool calls, and handles error recovery.
solidstate-studio
A visual IDE dashboard (coming soon). Will enable developers to visually inspect active agent graphs, trace conversation histories, view generated Mermaid diagrams, and inject state checkpoints.
stategraph-engine
Orchestrator for complex pipelines. Connect nodes, define conditional edges, map routing decisions, and pipe specialized agents together with expressive symbolic operators.
Active Research & Case Studies
Evaluating production constraints, context budgets, and distributed state layouts.
Mitigating Latency with Response Caching
Running agentic loops repeatedly often generates identical tool-invocation patterns. By hashing state layouts and matching cached responses, lookup times drop to sub-millisecond rates (<1ms) instead of standard LLM call delays.
Human-in-the-Loop Interrupts
High-risk actions require validation. We demonstrate an execution flow that pauses code execution inside serverless Lambdas, serializes the agent state to DynamoDB, and wakes up immediately upon user HTTP approval.
Orchestrate Agents Safely
SolidState is open source and designed to fit cloud infrastructure. Run fully locally with Ollama, or deploy distributed agent loops using Redis and AWS CloudWatch logging.