New:Microsoft Teams Notifications Are Now Available in Socket.Learn more →
Get Started

@memstack/server

Package Overview
Dependencies
Maintainers
1
Versions
7
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@memstack/server

REST API server for MemStack — self-hostable agent memory

Source
npmnpm
Version
0.6.4
Version published
Weekly downloads
22
-87.64%
Maintainers
1
Weekly downloads
 
Created
Source

@memstack/server

REST API server for MemStack — self-hostable agent memory. Run anywhere Bun runs.

Installation

npm install @memstack/server
# or via Docker:
docker pull ghcr.io/isiomac/memstack-server:v0.5.0

Quick Start

bun run node_modules/@memstack/server/dist/index.js
# or via Docker:
docker run -p 3000:3000 -e MEMSTACK_STORAGE=memory -e OPENAI_API_KEY=sk-... ghcr.io/isiomac/memstack-server:v0.5.0

Configuration

All via environment variables.

VariablePurposeDefault
MEMSTACK_STORAGEStorage backend (memory, disk, markdown, postgres, sqlite, redis)memory
MEMSTACK_DIRDirectory for markdown/disk./memories
DATABASE_URLPostgres connection—
SQLITE_PATHSQLite database path./memstack.db
REDIS_URLRedis connectionredis://localhost:6379
OPENAI_API_KEYOpenAI LLM + embeddings—
ANTHROPIC_API_KEYAnthropic LLM (summarization)—
MEMSTACK_OPENAI_BASE_URLCustom API endpoint (DeepSeek, etc)https://api.openai.com/v1
MEMSTACK_LLM_MODELModel overridegpt-4o-mini
MEMSTACK_EMBED_ON_STOREAuto-embed on storetrue
MEMSTACK_API_KEYBearer token auth (optional)—
MEMSTACK_RATE_LIMITRequests/minute limit0 (disabled)
PORTHTTP port3000

API Endpoints

MethodPathDescription
POST/v1/memoriesStore a memory
POST/v1/memories/batchStore multiple memories
POST/v1/memories/retrieveRetrieve memories
POST/v1/memories/contextCompile LLM-ready context
POST/v1/memories/processStore with auto-enrichment
POST/v1/memories/mergeMerge multiple memories
POST/v1/memories/purgeDelete all for an actor
POST/v1/memories/delete-manyDelete multiple by ID
POST/v1/memories/importImport JSON snapshot
GET/v1/memories/:idGet by ID
DELETE/v1/memories/:idDelete by ID
POST/v1/memories/:id/touchBump recency
GET/v1/memories/countCount with filters
GET/v1/memories/exportExport snapshot
POST/v1/summarizeCompress old memories
GET/v1/summarize/streamStream summary via SSE
POST/v1/pruneRemove stale memories
POST/v1/prune/dry-runPreview prune
GET/v1/stats/:actorIdMemory diagnostics
GET/healthHealth check

Usage Examples

# Health check
curl http://localhost:3000/health

# Store a memory
curl -X POST http://localhost:3000/v1/memories \
  -H "Content-Type: application/json" \
  -d '{"actorId":"agent-1","content":"User reported login bug","importance":0.8}'

# Retrieve
curl -X POST http://localhost:3000/v1/memories/retrieve \
  -H "Content-Type: application/json" \
  -d '{"actorId":"agent-1"}'

# Compile context
curl -X POST http://localhost:3000/v1/memories/context \
  -H "Content-Type: application/json" \
  -d '{"actorId":"agent-1","maxTokens":500}'

# Stream summarization (SSE)
curl -N "http://localhost:3000/v1/summarize/stream?actorId=agent-1&olderThan=2026-01-01T00:00:00Z"

Docker

docker run -p 3000:3000 \
  -e MEMSTACK_STORAGE=postgres \
  -e DATABASE_URL=postgresql://... \
  -e OPENAI_API_KEY=sk-... \
  ghcr.io/isiomac/memstack-server:v0.5.0

License

MIT

Keywords

api

FAQs

Package last updated on 26 Jun 2026

Related posts