{"_id":"@atisse/memory-redis","_rev":"3-d938ad04b11edef27fb7019f2e923db5","name":"@atisse/memory-redis","dist-tags":{"latest":"1.1.1"},"versions":{"1.0.0":{"name":"@atisse/memory-redis","version":"1.0.0","_id":"@atisse/memory-redis@1.0.0","maintainers":[{"name":"softendo","email":"kadirkaradas5@gmail.com"}],"dist":{"shasum":"370bbf36b3cf5ae61397740a9ba6245c2e9f25b2","tarball":"https://registry.npmjs.org/@atisse/memory-redis/-/memory-redis-1.0.0.tgz","fileCount":5,"integrity":"sha512-xpue3TXr5gonN2LjvM+GZIE53qI2wLAQjXHs/nodKSP9/3ZtSo57X7a1rSL8KM9k90H1cFh2Kf6HAQ/wlYY2Og==","signatures":[{"sig":"MEUCIG9YjbcQ2olAu4ZVde80JrLZAqruO/kI4DUWULavGAAZAiEAzOBg92HKLRNld8QUcuTMIe9POiIJL0Rdc4g1yCw9OAE=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":6917},"main":"./dist/index.js","type":"module","types":"./dist/index.d.ts","module":"./dist/index.js","engines":{"node":">=24"},"exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js","require":"./dist/index.cjs"}},"gitHead":"766fc1f9364cd3ca6750ca4c1dc4110f5b613b73","scripts":{"lint":"eslint src/","test":"vitest run","build":"tsup","typecheck":"tsc --noEmit","test:watch":"vitest","test:coverage":"vitest run --coverage"},"_npmUser":{"name":"softendo","email":"kadirkaradas5@gmail.com"},"_npmVersion":"11.17.0","directories":{},"_nodeVersion":"24.14.1","_hasShrinkwrap":false,"packageManager":"pnpm@11.5.0","peerDependencies":{"redis":"^6.0.0","@atisse/core":"workspace:*"},"_npmOperationalInternal":{"tmp":"tmp/memory-redis_1.0.0_1781528307802_0.19288898789155917","host":"s3://npm-registry-packages-npm-production"}},"1.1.0":{"name":"@atisse/memory-redis","version":"1.1.0","keywords":["llm","ai","memory","redis","adapter","typescript","orchestration","conversation"],"author":"Abdulkadir Karadas(saferias)","license":"MIT","_id":"@atisse/memory-redis@1.1.0","maintainers":[{"name":"softendo","email":"kadirkaradas5@gmail.com"}],"homepage":"https://github.com/abdulkadirkaradas/atisse#readme","bugs":{"url":"https://github.com/abdulkadirkaradas/atisse/issues"},"dist":{"shasum":"eca37f71fcb28938c519e0c88c97ac735a15977b","tarball":"https://registry.npmjs.org/@atisse/memory-redis/-/memory-redis-1.1.0.tgz","fileCount":7,"integrity":"sha512-GXhLak26tFjg7xpbc5kQIZEdEVNvT7aYTz7ruOizT/Dl2WrK2WamkyFwA+nN73pX1/VfzZVmkuxTnZMy4X6GQA==","signatures":[{"sig":"MEQCIClGTZCv1SHGEtN/difn9+niOzz6M9OKY9KS9VLC2CiyAiA/GoA+G9l6bGXDujcO76RqTIbRpaS1rgj1Ko/vmcHwmA==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":13689},"main":"./dist/index.js","type":"module","types":"./dist/index.d.ts","module":"./dist/index.js","engines":{"node":">=24"},"exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js","require":"./dist/index.cjs"}},"scripts":{"lint":"eslint src/","test":"vitest run","build":"tsup","typecheck":"tsc --noEmit","test:watch":"vitest","test:coverage":"vitest run --coverage"},"_npmUser":{"name":"softendo","email":"kadirkaradas5@gmail.com"},"repository":{"url":"git+https://github.com/abdulkadirkaradas/atisse.git","type":"git","directory":"packages/memory-redis"},"directories":{},"_nodeVersion":"24.14.1","_hasShrinkwrap":false,"peerDependencies":{"redis":"^6.0.0","@atisse/core":"1.0.1"},"_npmOperationalInternal":{"tmp":"tmp/memory-redis_1.1.0_1781790864363_0.4695831663894088","host":"s3://npm-registry-packages-npm-production"}},"1.1.1":{"name":"@atisse/memory-redis","version":"1.1.1","engines":{"node":">=24"},"type":"module","license":"MIT","main":"./dist/index.js","module":"./dist/index.js","types":"./dist/index.d.ts","exports":{".":{"import":"./dist/index.js","types":"./dist/index.d.ts","require":"./dist/index.cjs"}},"author":"Abdulkadir Karadas(saferias)","repository":{"type":"git","url":"git+https://github.com/abdulkadirkaradas/atisse.git","directory":"packages/memory-redis"},"bugs":{"url":"https://github.com/abdulkadirkaradas/atisse/issues"},"homepage":"https://github.com/abdulkadirkaradas/atisse#readme","keywords":["llm","ai","memory","redis","adapter","typescript","orchestration","conversation"],"peerDependencies":{"redis":"^6.0.0","@atisse/core":"1.1.0"},"scripts":{"typecheck":"tsc --noEmit","lint":"eslint src/","test":"vitest run","test:watch":"vitest","test:coverage":"vitest run --coverage","build":"tsup"},"_nodeVersion":"24.19.0","_id":"@atisse/memory-redis@1.1.1","dist":{"integrity":"sha512-V0d/GB9bnR4eKqHt870tEq7MXdwUgNFYOWIhnxNVw5pFCA/q3IsedJNTwt5kwRncoxyXBEH7Vx20LLJ3iz0lPg==","shasum":"ce26ab3053159d1d58b8c9da90773bc55a67bcd0","tarball":"https://registry.npmjs.org/@atisse/memory-redis/-/memory-redis-1.1.1.tgz","fileCount":7,"unpackedSize":15679,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCIQDDvNe3Ddf56ty1JBCZmLd7urTj/S03V9elKkZBeLgfvgIgDH1GXoY5jh42nRdhe7jWLlCzHFZoAsKWDcLCxm1adnY="}]},"_npmUser":{"name":"softendo","email":"kadirkaradas5@gmail.com"},"directories":{},"maintainers":[{"name":"softendo","email":"kadirkaradas5@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/memory-redis_1.1.1_1789407362684_0.9806977645173476"},"_hasShrinkwrap":false}},"time":{"created":"2026-06-15T12:58:27.666Z","modified":"2026-09-14T17:36:03.015Z","1.0.0":"2026-06-15T12:58:27.930Z","1.1.0":"2026-06-18T13:54:24.513Z","1.1.1":"2026-09-14T17:36:02.819Z"},"bugs":{"url":"https://github.com/abdulkadirkaradas/atisse/issues"},"author":"Abdulkadir Karadas(saferias)","license":"MIT","homepage":"https://github.com/abdulkadirkaradas/atisse#readme","keywords":["llm","ai","memory","redis","adapter","typescript","orchestration","conversation"],"repository":{"type":"git","url":"git+https://github.com/abdulkadirkaradas/atisse.git","directory":"packages/memory-redis"},"maintainers":[{"name":"softendo","email":"kadirkaradas5@gmail.com"}],"readme":"# @atisse/memory-redis\n\n[![npm version](https://img.shields.io/npm/v/@atisse/memory-redis.svg)](https://www.npmjs.com/package/@atisse/memory-redis)\n[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)\n\nA Redis-backed implementation of the `MemoryAdapter` interface for `@atisse/core`. Persists conversation history in Redis with configurable TTL, making it suitable for production deployments with session-based chat applications.\n\n## Features\n\n- Persistent conversation history via Redis\n- Automatic connection management — pass an existing client or let the adapter connect with a URL\n- Configurable TTL per session key (default: 1 hour)\n- Append semantics on `save()` — preserves existing session history\n- Keys namespaced under `atisse:session:{sessionId}`\n- Auto-connect on first operation when using URL-based configuration\n\n## Installation\n\n```bash\nnpm install @atisse/memory-redis\n# or\npnpm add @atisse/memory-redis\n```\n\n> `@atisse/core` and `redis@^6.0.0` are peer dependencies. Install them alongside this package.\n\n## Quick Start\n\n```typescript\nimport { Orchestrator } from '@atisse/core';\nimport { RedisMemoryAdapter } from '@atisse/memory-redis';\n\n// Option 1: Connect with a URL (adapter manages the connection)\nconst memory = new RedisMemoryAdapter({\n  url: 'redis://localhost:6379',\n  ttlSeconds: 7200, // 2 hour TTL\n});\n\n// Option 2: Pass an existing Redis client\n// import { createClient } from 'redis';\n// const client = createClient({ url: 'redis://localhost:6379' });\n// await client.connect();\n// const memory = new RedisMemoryAdapter({ client });\n\nconst orchestrator = new Orchestrator({\n  provider: myProvider,\n  memoryAdapter: memory,\n});\n\n// Conversation history is persisted across runs\nawait orchestrator.run({\n  prompt: 'Remember that I like cats.',\n  sessionId: 'user-42',\n});\n\nawait orchestrator.run({\n  prompt: 'What do I like?',\n  sessionId: 'user-42',\n  // Core loads previous messages — the LLM has context\n});\n```\n\n## API Reference\n\n### `RedisMemoryAdapter`\n\nImplements `MemoryAdapter` from `@atisse/core`. Stores serialized message arrays under keys prefixed with `atisse:session:`.\n\n**Constructor**\n\n```typescript\nnew RedisMemoryAdapter(config: { client: RedisClientType } | { url: string; ttlSeconds?: number })\n```\n\nTwo configuration modes:\n\n| Mode   | Field        | Type              | Default | Description                                                                              |\n| ------ | ------------ | ----------------- | ------- | ---------------------------------------------------------------------------------------- |\n| Client | `client`     | `RedisClientType` | —       | An existing connected Redis client instance. The adapter will not manage its lifecycle.  |\n| URL    | `url`        | `string`          | —       | Redis connection URL (e.g. `redis://localhost:6379`). The adapter connects on first use. |\n| URL    | `ttlSeconds` | `number`          | `3600`  | TTL for session keys in seconds.                                                         |\n\n**Methods**\n\n| Method  | Signature                                                   | Description                                                                               |\n| ------- | ----------------------------------------------------------- | ----------------------------------------------------------------------------------------- |\n| `load`  | `(sessionId: string) => Promise<Message[]>`                 | Retrieves all messages for the session. Returns an empty array if the key does not exist. |\n| `save`  | `(sessionId: string, messages: Message[]) => Promise<void>` | Appends messages to the session's existing history using `setEx` with the configured TTL. |\n| `clear` | `(sessionId: string) => Promise<void>`                      | Deletes the session key. Idempotent.                                                      |\n\n### Error handling\n\nRedis errors are wrapped as `ContextLoadError` from `@atisse/core`, which is retryable by the core pipeline. Connection failures during URL-based setups are handled the same way.\n\n## Monorepo Ecosystem\n\n`@atisse/*` packages are part of the [atisse](https://github.com/abdulkadirkaradas/atisse) monorepo.\n\n- **[@atisse/core](../core)** — Execution kernel (required peer dependency)\n- **[@atisse/context-rag](../context-rag)** — RAG context provider\n- **[@atisse/memory-inmemory](../memory-inmemory)** — In-memory memory adapter\n- **[@atisse/provider-anthropic](../provider-anthropic)** — Anthropic Claude provider\n- **[@atisse/provider-openai](../provider-openai)** — OpenAI GPT provider\n\n## License\n\nMIT © [Abdulkadir Karadas(saferias)](https://github.com/abdulkadirkaradas)\n","readmeFilename":""}