Skip to content

Configure Session Storage

This guide explains how to configure session storage for maintaining conversation state across connections.

Omnia supports two session storage backends:

BackendUse CasePersistence
MemoryDevelopment, testingPod lifetime only
RedisProduction, multi-replicaPersistent

In-memory storage is the default and requires no additional configuration:

apiVersion: omnia.altairalabs.ai/v1alpha1
kind: AgentRuntime
metadata:
name: my-agent
spec:
# ... other config
session:
type: memory
ttl: 1h

Note: Sessions are lost when the pod restarts. Not suitable for production with multiple replicas.

For production deployments, use Redis:

Terminal window
kubectl create namespace redis
helm install redis bitnami/redis -n redis \
--set auth.password=your-redis-password
apiVersion: v1
kind: Secret
metadata:
name: redis-credentials
type: Opaque
stringData:
url: "redis://:your-redis-password@redis-master.redis.svc:6379"
apiVersion: omnia.altairalabs.ai/v1alpha1
kind: AgentRuntime
metadata:
name: my-agent
spec:
# ... other config
session:
type: redis
ttl: 24h
storeRef:
name: redis-credentials
key: url

The ttl field controls how long sessions remain valid after the last activity:

session:
ttl: 1h # Sessions expire after 1 hour of inactivity

Supported formats:

  • 30m - 30 minutes
  • 1h - 1 hour
  • 24h - 24 hours
  • 168h - 1 week

Clients can resume existing sessions by providing the session ID:

{
"type": "message",
"session_id": "existing-session-id",
"content": "Continue our conversation..."
}

If the session exists and hasn’t expired, the conversation history is preserved.

Each session stores:

  • Conversation messages
  • Agent state
  • Custom metadata

Access session data programmatically using the session ID returned in the connected message:

{"type": "connected", "session_id": "sess-abc123"}