AINL Memory - Graph-Based Agent Memory Substrate
Graph-as-memory for AI agents. Execution IS the memory.
AINL Memory is a Rust library that implements agent memory as an execution graph. Every agent turn, tool call, and delegation becomes a typed graph node. No separate retrieval layer—the graph itself is the memory.
Why AINL Memory?
Most agent frameworks treat memory as separate from execution:
- Execute → Store text → Retrieve → Execute again
- Separate episodic, semantic, and procedural stores
- Memory retrieval adds latency and complexity
AINL Memory unifies execution and memory:
- Episodic memory: What happened during agent turns (tool calls, delegations)
- Semantic memory: Facts learned with confidence scores
- Procedural memory: Reusable compiled workflow patterns
- Persona memory: Agent traits learned over time
All stored as typed graph nodes with edges for traversal.
Quick Start
[]
= "0.1.0-alpha"
use ;
// Open a graph store
let store = open.unwrap;
// Record an agent delegation
let node = new_delegation_episode;
store.write_node.unwrap;
// Query recent episodes
let episodes = store.query_recent_episodes.unwrap;
Features
- Typed graph nodes: Episode, Semantic, Procedural, Persona
- SQLite backend: Persistent graph storage with indexes
- Graph traversal: Walk edges between nodes
- Swappable backends: Implement
GraphStoretrait for custom storage - Zero unsafe code: Pure Rust implementation
- Offline-first: No network required, local SQLite storage
Node Types
Episode
Records what happened during an agent turn:
- Tool calls executed
- Delegation to other agents
- Trace ID for correlation
- Delegation depth
Semantic
Facts learned with confidence:
- Fact text
- Confidence score (0.0-1.0)
- Source turn ID
Procedural
Reusable workflow patterns:
- Pattern name
- Compiled graph (binary format)
Persona
Agent traits learned over time:
- Trait name
- Strength (0.0-1.0)
- Source turn IDs
Architecture
AINL Memory is designed as infrastructure that any agent framework can adopt:
- No dependencies on specific agent runtimes
- Simple trait-based API
- Bring your own storage backend
Status
Alpha (0.1.0-alpha)
API is subject to change. Production-ready for experimentation.
License
Licensed under either of:
- Apache License, Version 2.0 (LICENSE-APACHE or http://www.apache.org/licenses/LICENSE-2.0)
- MIT license (LICENSE-MIT or http://opensource.org/licenses/MIT)
at your option.
Contributing
Contributions are welcome! This is early-stage infrastructure—your feedback shapes the API.
See Also
- ainl-runtime - AINL execution runtime (coming soon)
- AINL Specification - AI Native Language design