Storage — Agentuity Documentation

Storage

Persistent storage options for agents and routes

Agentuity provides multiple storage options to match different data access patterns.

Storage Types

When to Use Each Type

Storage TypeBest ForAccess Pattern
Key-ValueCaching, session data, rate limitsFast key-based lookups
VectorSemantic search, embeddings, RAGSimilarity search
ObjectFiles, images, large blobsURL-based access
Durable StreamsLogs, exports, event streamsAppend-only, ordered reads
DatabaseRelational data, complex queriesSQL queries

Built-in State vs Storage

Agents have built-in state that persists across requests:

State TypeScopeUse For
ctx.stateAgent instanceRequest-local data
ctx.thread.stateThreadConversation context
ctx.session.stateSessionUser preferences

Use storage services when you need:

  • Custom TTL or expiration
  • Data shared across agents
  • Persistent data beyond sessions
  • External system integration

Access Patterns

ContextKVVectorObject
Agentsctx.kvctx.vectorsctx.storage
Routesc.var.kvc.var.vectorsc.var.storage

Custom Storage

For specialized needs, you can implement custom storage backends that integrate with external systems.