Skip to content
ALTAIRA LABS
DocsBlog

Configure context store

This guide explains how to configure the context store for maintaining conversation state across connections.

Omnia supports two context store backends:

Backend Use Case Persistence
Memory Development, testing Pod lifetime only
Redis Production, multi-replica Persistent

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
context:
type: memory
ttl: 1h

Note: Context is 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
context:
type: redis
ttl: 24h
storeRef:
name: redis-credentials
key: url

The ttl field controls how long context remains valid after the last activity:

context:
ttl: 1h # Context expires 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"}