Get Redis storage up and running with NeuroLink in under 5 minutes.
- Docker installed OR Redis installed locally
- NeuroLink SDK installed (
pnpm add @juspay/neurolink)
The fastest way to get Redis running for development and testing.
# Start Redis with persistence
docker run -d \
--name neurolink-redis \
-p 6379:6379 \
-v redis-data:/data \
redis:7-alpine
# Verify Redis is running
docker ps | grep neurolink-redis# Test Redis connectivity
docker exec -it neurolink-redis redis-cli ping
# Expected output: PONG# Install Redis with Homebrew
brew install redis
# Start Redis service
brew services start redis
# Verify installation
redis-cli ping
# Expected output: PONG# Install Redis
sudo apt update
sudo apt install redis-server -y
# Start Redis service
sudo systemctl start redis-server
sudo systemctl enable redis-server
# Verify installation
redis-cli ping
# Expected output: PONG# Update packages
sudo apt update
# Install Redis
sudo apt install redis-server -y
# Start Redis
sudo service redis-server start
# Test connection
redis-cli ping
# Expected output: PONG# Add to your .env file
REDIS_HOST=localhost
REDIS_PORT=6379
REDIS_PASSWORD= # Leave empty for local dev
REDIS_DB=0import { NeuroLink } from "@juspay/neurolink";
const neurolink = new NeuroLink({
conversationMemory: {
enabled: true,
store: "redis",
redisConfig: {
host: "localhost",
port: 6379,
db: 0,
},
},
});
// Use neurolink as normal
const result = await neurolink.generate({
input: { text: "Hello! How are you?" },
provider: "openai",
});
console.log(result.content);// Check conversation persistence
const stats = await neurolink.conversationMemory?.getStats();
console.log(stats); // { totalSessions: 1, totalTurns: 1 }# In your Node.js console
const neurolink = new NeuroLink({
conversationMemory: {
enabled: true,
store: "redis",
redisConfig: { host: "localhost", port: 6379 }
}
});
// Generate a conversation
await neurolink.generate({
input: { text: "Remember this: my favorite color is blue" },
sessionId: "test-session",
userId: "test-user",
});
// Stop your app, restart, and verify data persists
const history = await neurolink.conversationMemory?.getUserSessionHistory(
"test-user",
"test-session"
);
console.log(history); // Should show your conversation# Connect to Redis CLI
docker exec -it neurolink-redis redis-cli
# OR (local install)
redis-cli
# List all keys
127.0.0.1:6379> KEYS *
# Expected: Shows NeuroLink conversation keys
# Check a specific session
127.0.0.1:6379> GET neurolink:conversation:test-user:test-session
# Shows conversation data in JSON formatProblem: Cannot connect to Redis
# Check if Redis is running
docker ps | grep neurolink-redis
# OR
sudo systemctl status redis-server
# Restart if needed
docker restart neurolink-redis
# OR
sudo systemctl restart redis-serverProblem: Port 6379 is already taken
# Use a different port for Redis
docker run -d --name neurolink-redis -p 6380:6379 redis:7-alpine
# Update NeuroLink config
redisConfig: { host: "localhost", port: 6380 }Problem: Cannot access Redis socket (Linux)
# Add your user to the redis group
sudo usermod -a -G redis $USER
# Restart Redis
sudo systemctl restart redis-server- Complete Redis Configuration Guide - Production setup, clustering, security
- Redis Migration Patterns - Migrate from in-memory to Redis
- Conversation Memory Guide - Advanced conversation management
Before going to production, review:
- Security: Set
requirepassin Redis configuration - Persistence: Enable AOF (Append-Only File) for data durability
- Monitoring: Set up health checks and alerts
- Backup: Configure automated backup schedule
- Performance: Tune
maxmemoryand eviction policies
See the Complete Redis Configuration Guide for production best practices.
Need Help? Check our Troubleshooting Guide or open an issue on GitHub.