Add Components
Extend your agent project with additional features.
Commands
- sekuire add memory - Add a memory backend
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
| Backend | Type | Best For |
|---|---|---|
| In-Memory | Ephemeral | Development, testing |
| SQLite | Local file | Single-instance deployments |
| Redis | Self-hosted | Multi-instance with existing Redis |
| PostgreSQL | Self-hosted | Multi-instance with existing Postgres |
| Upstash Redis | Serverless | Serverless deployments |
| Cloudflare KV | Edge | Cloudflare Workers |
| Cloudflare D1 | Edge SQLite | Cloudflare Workers |
| AWS DynamoDB | Serverless | AWS deployments |
| Turso | Edge SQLite | Edge deployments |
| Convex | Serverless | Real-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
| Backend | Package |
|---|---|
| SQLite | better-sqlite3 |
| Redis | redis |
| PostgreSQL | pg |
| Upstash | @upstash/redis |
| DynamoDB | @aws-sdk/client-dynamodb, @aws-sdk/lib-dynamodb |
| Turso | @libsql/client |
| Convex | convex |
Terminal
# Example: SQLite
npm install better-sqlite3
# Example: Upstash
npm install @upstash/redis
Python
| Backend | Package |
|---|---|
| SQLite | (included in stdlib) |
| Redis | redis |
| PostgreSQL | psycopg2-binary |
| Upstash | upstash-redis |
| DynamoDB | boto3 |
| Turso | libsql-experimental |
Terminal
# Example: Redis
pip install redis
# Example: PostgreSQL
pip install psycopg2-binary
Environment Variables
Some backends require environment variables:
| Backend | Variables |
|---|---|
| Upstash | UPSTASH_REDIS_REST_TOKEN |
| Cloudflare | CF_ACCOUNT_ID, CF_API_TOKEN |
| DynamoDB | AWS_ACCESS_KEY_ID, AWS_SECRET_ACCESS_KEY, AWS_REGION |
| Turso | TURSO_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)