A Semantic State Engine for AI agents with a unified intent-based API.
One API to handle everything - agents just express intent naturally, the engine figures out the rest.
This monorepo contains the following packages:
| Package | Language | Description | Status |
|---|---|---|---|
| agent-state-rs | Rust | Core semantic state engine | Stable |
| agent-state-py | Python | Python SDK with native bindings | Alpha |
| agent-state-ts | TypeScript | TypeScript/JavaScript SDK | Placeholder |
use agent_brain::AgentEngine;
let engine = AgentEngine::new()?;
// Store information - intent is auto-detected
engine.process("My favorite color is blue"); // Auto: STORE + MEMORY
engine.process("Remind me to call John"); // Auto: STORE + TASK
// Query information - intent is auto-detected
engine.process("What is my favorite color?"); // Auto: QUERY
engine.process("Who should I call?"); // Auto: QUERYfrom agent_state import AgentEngine
engine = AgentEngine()
# Store and query with auto-detection
engine.process("My favorite color is blue")
result = engine.process("What is my favorite color?")import { AgentEngine } from "@agent-state/sdk";
const engine = new AgentEngine();
engine.process("My favorite color is blue");
const result = engine.process("What is my favorite color?");The engine automatically classifies:
- Action: Is this a store request or query request?
- DataType: Is this a task (action item) or memory (fact)?
enum AgentResponse {
Stored { id, data_type, content }, // Data was saved
QueryResult { results, count, data_type }, // Query returned matches
NotFound { query }, // No results found
}- Rust 1.70+
- Python 3.9+ (for Python SDK)
- Node.js 18+ (for TypeScript SDK)
# Rust core
cd packages/agent-state-rs
cargo build --release
# Python SDK
cd packages/agent-state-py
pip install maturin
maturin develop
# TypeScript SDK
cd packages/agent-state-ts
npm install
npm run build# Rust
cd packages/agent-state-rs
cargo test
# Python
cd packages/agent-state-py
pytest
# TypeScript
cd packages/agent-state-ts
npm testpackages/
├── agent-state-rs/ # Rust core engine
│ ├── src/
│ │ ├── lib.rs # Public API
│ │ ├── brain.rs # AI model & classification
│ │ ├── storage.rs # SQLite vector storage
│ │ └── ...
│ └── tests/
├── agent-state-py/ # Python SDK
│ ├── python/ # Pure Python code
│ └── src/ # Rust bindings (PyO3)
└── agent-state-ts/ # TypeScript SDK
└── src/ # TypeScript implementation
MIT