Skip to main content

Add Components

Extend your agent project with additional features.

Commands


add memory

Add a memory storage backend to your agent for conversation history, state persistence, or caching.

sekuire add memory

Interactive Selection

Running the command presents a menu of memory backend options:

Terminal
$ sekuire add memory

Select memory backend for your agent:
❯ In-Memory (ephemeral)
SQLite (local file)
Redis (self-hosted)
PostgreSQL
Upstash Redis (serverless)
Cloudflare KV
Cloudflare D1
AWS DynamoDB
Turso (edge SQLite)
Convex

Available Backends

BackendTypeBest For
In-MemoryEphemeralDevelopment, testing
SQLiteLocal fileSingle-instance deployments
RedisSelf-hostedMulti-instance with existing Redis
PostgreSQLSelf-hostedMulti-instance with existing Postgres
Upstash RedisServerlessServerless deployments
Cloudflare KVEdgeCloudflare Workers
Cloudflare D1Edge SQLiteCloudflare Workers
AWS DynamoDBServerlessAWS deployments
TursoEdge SQLiteEdge deployments
ConvexServerlessReal-time applications

Configuration

The command updates your sekuire.yml with the memory configuration:

sekuire.yml
agent:
memory:
type: "sqlite"
config:
filename: "./agent_memory.db"

Configuration by Backend

In-Memory (Buffer)

agent:
memory:
type: "buffer"
max_messages: 10

No dependencies required. Data is lost on restart.

SQLite

agent:
memory:
type: "sqlite"
config:
filename: "./agent_memory.db"

Redis

agent:
memory:
type: "redis"
config:
url: "redis://localhost:6379"

PostgreSQL

agent:
memory:
type: "postgres"
config:
url: "postgresql://localhost:5432/sekuire"

Upstash Redis

agent:
memory:
type: "upstash"
config:
url: "https://xxx.upstash.io"
token: "${UPSTASH_REDIS_REST_TOKEN}"

Cloudflare KV

agent:
memory:
type: "cloudflare-kv"
config:
namespace_id: "your-namespace-id"
account_id: "${CF_ACCOUNT_ID}"
api_token: "${CF_API_TOKEN}"

Cloudflare D1

agent:
memory:
type: "cloudflare-d1"
config:
database_id: "your-database-id"
account_id: "${CF_ACCOUNT_ID}"
api_token: "${CF_API_TOKEN}"

AWS DynamoDB

agent:
memory:
type: "dynamodb"
config:
table_name: "sekuire-memory"
region: "us-east-1"

Turso

agent:
memory:
type: "turso"
config:
url: "libsql://xxx.turso.io"
auth_token: "${TURSO_AUTH_TOKEN}"

Convex

agent:
memory:
type: "convex"
config:
url: "https://xxx.convex.cloud"

Dependencies

Install the required package for your chosen backend:

Node.js

BackendPackage
SQLitebetter-sqlite3
Redisredis
PostgreSQLpg
Upstash@upstash/redis
DynamoDB@aws-sdk/client-dynamodb, @aws-sdk/lib-dynamodb
Turso@libsql/client
Convexconvex
Terminal
# Example: SQLite
npm install better-sqlite3

# Example: Upstash
npm install @upstash/redis

Python

BackendPackage
SQLite(included in stdlib)
Redisredis
PostgreSQLpsycopg2-binary
Upstashupstash-redis
DynamoDBboto3
Tursolibsql-experimental
Terminal
# Example: Redis
pip install redis

# Example: PostgreSQL
pip install psycopg2-binary

Environment Variables

Some backends require environment variables:

BackendVariables
UpstashUPSTASH_REDIS_REST_TOKEN
CloudflareCF_ACCOUNT_ID, CF_API_TOKEN
DynamoDBAWS_ACCESS_KEY_ID, AWS_SECRET_ACCESS_KEY, AWS_REGION
TursoTURSO_AUTH_TOKEN

Example Workflow

Terminal
# Add memory to existing project
$ sekuire add memory

Select memory backend for your agent:
In-Memory (ephemeral)
❯ SQLite (local file)
...

SQLite database file: ./agent_memory.db

Memory backend configured successfully!
Type: sqlite
Config updated in sekuire.yml

Install the required dependency:
npm install better-sqlite3
# or
pip install sqlite3 # (included in Python stdlib)

Next Steps

  • init - Initialize a new project with memory built-in
  • run - Run your agent locally