@agentskit/memory 0.5.0 → 0.5.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -1,14 +1,22 @@
1
1
  # @agentskit/memory
2
2
 
3
- ![stability: stable](https://img.shields.io/badge/stability-stable-brightgreen)
4
-
5
3
  Persist conversations and add vector search to your agents — swap backends without changing agent code.
6
4
 
7
- ## Why
5
+ [![npm version](https://img.shields.io/npm/v/@agentskit/memory?color=blue)](https://www.npmjs.com/package/@agentskit/memory)
6
+ [![npm downloads](https://img.shields.io/npm/dm/@agentskit/memory)](https://www.npmjs.com/package/@agentskit/memory)
7
+ [![bundle size](https://img.shields.io/bundlephobia/minzip/@agentskit/memory)](https://bundlephobia.com/package/@agentskit/memory)
8
+ [![license](https://img.shields.io/npm/l/@agentskit/memory)](../../LICENSE)
9
+ [![stability](https://img.shields.io/badge/stability-stable-brightgreen)](../../docs/STABILITY.md)
10
+ [![GitHub stars](https://img.shields.io/github/stars/AgentsKit-io/agentskit?style=social)](https://github.com/AgentsKit-io/agentskit)
11
+
12
+ **Tags:** `ai` · `agents` · `llm` · `agentskit` · `ai-agents` · `memory` · `vector-db` · `embeddings` · `rag` · `sqlite` · `redis` · `vector-search`
13
+
14
+ ## Why memory
8
15
 
9
16
  - **Conversations that survive restarts** — SQLite for local development, Redis for production; your agent remembers context across sessions with zero code changes
10
17
  - **RAG-ready vector search** — store and retrieve embeddings with `fileVectorMemory` (pure JS, no native deps) or Redis vector search for scale
11
18
  - **Plug any backend** — the `VectorStore` interface is 3 methods; bring LanceDB, Pinecone, or any custom store in minutes
19
+ - **One interface, every deployment target** — swap from `inMemory` to `sqlite` to `redis` without touching agent code
12
20
 
13
21
  ## Install
14
22
 
@@ -39,10 +47,12 @@ console.log(result.content)
39
47
 
40
48
  Use a **vector** backend with [`@agentskit/rag`](https://www.npmjs.com/package/@agentskit/rag) `createRAG({ embed, store })` — `fileVectorMemory` and `redisVectorMemory` implement `VectorMemory` for chunk storage and search.
41
49
 
42
- ## Next steps
50
+ ## Features
43
51
 
44
- - Swap `sqliteChatMemory` for **Redis** or **in-memory** variants from the same package for different deployment targets
45
- - Pair **embedders** from [`@agentskit/adapters`](https://www.npmjs.com/package/@agentskit/adapters) with RAG — see [`@agentskit/rag`](https://www.npmjs.com/package/@agentskit/rag)
52
+ - Chat memory: `inMemoryChatMemory`, `sqliteChatMemory`, `redisChatMemory`, `fileChatMemory`
53
+ - Vector memory: `fileVectorMemory` (pure JS), `redisVectorMemory`
54
+ - `VectorMemory` interface — 3 methods, bring any custom store
55
+ - Memory contract v1 (ADR 0003) — substitutable across `runtime`, `useChat`, and `@agentskit/ink`
46
56
 
47
57
  ## Ecosystem
48
58
 
@@ -53,6 +63,16 @@ Use a **vector** backend with [`@agentskit/rag`](https://www.npmjs.com/package/@
53
63
  | [@agentskit/runtime](https://www.npmjs.com/package/@agentskit/runtime) | `memory` / `retriever` options |
54
64
  | [@agentskit/adapters](https://www.npmjs.com/package/@agentskit/adapters) | Embeddings for RAG |
55
65
 
66
+ ## Contributors
67
+
68
+ <a href="https://github.com/AgentsKit-io/agentskit/graphs/contributors">
69
+ <img src="https://contrib.rocks/image?repo=AgentsKit-io/agentskit" alt="AgentsKit contributors" />
70
+ </a>
71
+
72
+ ## License
73
+
74
+ MIT — see [LICENSE](../../LICENSE).
75
+
56
76
  ## Docs
57
77
 
58
- [Full documentation](https://emersonbraun.github.io/agentskit/)
78
+ [Full documentation](https://www.agentskit.io) · [GitHub](https://github.com/AgentsKit-io/agentskit)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@agentskit/memory",
3
- "version": "0.5.0",
3
+ "version": "0.5.2",
4
4
  "description": "Persistent and vector memory backends for AgentsKit.",
5
5
  "keywords": [
6
6
  "agentskit",
@@ -11,7 +11,16 @@
11
11
  "typescript",
12
12
  "memory",
13
13
  "vector",
14
- "embeddings"
14
+ "embeddings",
15
+ "openai",
16
+ "anthropic",
17
+ "ai-agents",
18
+ "vector-db",
19
+ "sqlite",
20
+ "redis",
21
+ "rag",
22
+ "vector-search",
23
+ "persistence"
15
24
  ],
16
25
  "type": "module",
17
26
  "main": "./dist/index.cjs",
@@ -31,7 +40,7 @@
31
40
  "access": "public"
32
41
  },
33
42
  "dependencies": {
34
- "@agentskit/core": "1.0.0"
43
+ "@agentskit/core": "1.1.0"
35
44
  },
36
45
  "devDependencies": {
37
46
  "@types/better-sqlite3": "^7.6.12",
@@ -1,8 +0,0 @@
1
- import type { VectorMemory } from '@agentskit/core';
2
- import type { VectorStore } from './vector-store';
3
- export interface FileVectorMemoryConfig {
4
- path: string;
5
- store?: VectorStore;
6
- }
7
- export declare function fileVectorMemory(config: FileVectorMemoryConfig): VectorMemory;
8
- //# sourceMappingURL=file-vector.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"file-vector.d.ts","sourceRoot":"","sources":["../src/file-vector.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAqC,MAAM,iBAAiB,CAAA;AACtF,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAA;AAEjD,MAAM,WAAW,sBAAsB;IACrC,IAAI,EAAE,MAAM,CAAA;IACZ,KAAK,CAAC,EAAE,WAAW,CAAA;CACpB;AAkED,wBAAgB,gBAAgB,CAAC,MAAM,EAAE,sBAAsB,GAAG,YAAY,CAkC7E"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,UAAU,CAAA;AAC3C,YAAY,EAAE,sBAAsB,EAAE,MAAM,UAAU,CAAA;AAEtD,OAAO,EAAE,eAAe,EAAE,MAAM,cAAc,CAAA;AAC9C,YAAY,EAAE,qBAAqB,EAAE,MAAM,cAAc,CAAA;AAEzD,OAAO,EAAE,iBAAiB,EAAE,MAAM,gBAAgB,CAAA;AAClD,YAAY,EAAE,uBAAuB,EAAE,MAAM,gBAAgB,CAAA;AAE7D,OAAO,EAAE,gBAAgB,EAAE,MAAM,eAAe,CAAA;AAChD,YAAY,EAAE,sBAAsB,EAAE,MAAM,eAAe,CAAA;AAE3D,YAAY,EAAE,WAAW,EAAE,mBAAmB,EAAE,iBAAiB,EAAE,MAAM,gBAAgB,CAAA;AACzF,YAAY,EAAE,kBAAkB,EAAE,qBAAqB,EAAE,MAAM,gBAAgB,CAAA"}
@@ -1,8 +0,0 @@
1
- import type { ChatMemory } from '@agentskit/core';
2
- import type { RedisConnectionConfig } from './redis-client';
3
- export interface RedisChatMemoryConfig extends RedisConnectionConfig {
4
- keyPrefix?: string;
5
- conversationId?: string;
6
- }
7
- export declare function redisChatMemory(config: RedisChatMemoryConfig): ChatMemory;
8
- //# sourceMappingURL=redis-chat.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"redis-chat.d.ts","sourceRoot":"","sources":["../src/redis-chat.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAyB,MAAM,iBAAiB,CAAA;AACxE,OAAO,KAAK,EAAsB,qBAAqB,EAAE,MAAM,gBAAgB,CAAA;AAG/E,MAAM,WAAW,qBAAsB,SAAQ,qBAAqB;IAClE,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,cAAc,CAAC,EAAE,MAAM,CAAA;CACxB;AA2BD,wBAAgB,eAAe,CAAC,MAAM,EAAE,qBAAqB,GAAG,UAAU,CA2BzE"}
@@ -1,19 +0,0 @@
1
- /**
2
- * Internal Redis client adapter interface.
3
- * Abstracts the underlying Redis library so it can be swapped
4
- * (e.g., from `redis` to `ioredis`) without changing consumers.
5
- */
6
- export interface RedisClientAdapter {
7
- get(key: string): Promise<string | null>;
8
- set(key: string, value: string): Promise<void>;
9
- del(key: string | string[]): Promise<void>;
10
- keys(pattern: string): Promise<string[]>;
11
- disconnect(): Promise<void>;
12
- call(command: string, ...args: (string | number | Buffer)[]): Promise<unknown>;
13
- }
14
- export interface RedisConnectionConfig {
15
- url: string;
16
- client?: RedisClientAdapter;
17
- }
18
- export declare function createRedisClientAdapter(url: string): Promise<RedisClientAdapter>;
19
- //# sourceMappingURL=redis-client.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"redis-client.d.ts","sourceRoot":"","sources":["../src/redis-client.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,MAAM,WAAW,kBAAkB;IACjC,GAAG,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC,CAAA;IACxC,GAAG,CAAC,GAAG,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAAA;IAC9C,GAAG,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,EAAE,GAAG,OAAO,CAAC,IAAI,CAAC,CAAA;IAC1C,IAAI,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,EAAE,CAAC,CAAA;IACxC,UAAU,IAAI,OAAO,CAAC,IAAI,CAAC,CAAA;IAC3B,IAAI,CAAC,OAAO,EAAE,MAAM,EAAE,GAAG,IAAI,EAAE,CAAC,MAAM,GAAG,MAAM,GAAG,MAAM,CAAC,EAAE,GAAG,OAAO,CAAC,OAAO,CAAC,CAAA;CAC/E;AAED,MAAM,WAAW,qBAAqB;IACpC,GAAG,EAAE,MAAM,CAAA;IACX,MAAM,CAAC,EAAE,kBAAkB,CAAA;CAC5B;AAED,wBAAsB,wBAAwB,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,kBAAkB,CAAC,CAgCvF"}
@@ -1,9 +0,0 @@
1
- import type { VectorMemory } from '@agentskit/core';
2
- import type { RedisConnectionConfig } from './redis-client';
3
- export interface RedisVectorMemoryConfig extends RedisConnectionConfig {
4
- indexName?: string;
5
- keyPrefix?: string;
6
- dimensions?: number;
7
- }
8
- export declare function redisVectorMemory(config: RedisVectorMemoryConfig): VectorMemory;
9
- //# sourceMappingURL=redis-vector.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"redis-vector.d.ts","sourceRoot":"","sources":["../src/redis-vector.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAqC,MAAM,iBAAiB,CAAA;AACtF,OAAO,KAAK,EAAsB,qBAAqB,EAAE,MAAM,gBAAgB,CAAA;AAG/E,MAAM,WAAW,uBAAwB,SAAQ,qBAAqB;IACpE,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,UAAU,CAAC,EAAE,MAAM,CAAA;CACpB;AAUD,wBAAgB,iBAAiB,CAAC,MAAM,EAAE,uBAAuB,GAAG,YAAY,CAiG/E"}
package/dist/sqlite.d.ts DELETED
@@ -1,7 +0,0 @@
1
- import type { ChatMemory } from '@agentskit/core';
2
- export interface SqliteChatMemoryConfig {
3
- path: string;
4
- conversationId?: string;
5
- }
6
- export declare function sqliteChatMemory(config: SqliteChatMemoryConfig): ChatMemory;
7
- //# sourceMappingURL=sqlite.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"sqlite.d.ts","sourceRoot":"","sources":["../src/sqlite.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAyB,MAAM,iBAAiB,CAAA;AAExE,MAAM,WAAW,sBAAsB;IACrC,IAAI,EAAE,MAAM,CAAA;IACZ,cAAc,CAAC,EAAE,MAAM,CAAA;CACxB;AA4CD,wBAAgB,gBAAgB,CAAC,MAAM,EAAE,sBAAsB,GAAG,UAAU,CAsC3E"}
@@ -1,16 +0,0 @@
1
- export interface VectorStoreDocument {
2
- id: string;
3
- vector: number[];
4
- metadata: Record<string, unknown>;
5
- }
6
- export interface VectorStoreResult {
7
- id: string;
8
- score: number;
9
- metadata: Record<string, unknown>;
10
- }
11
- export interface VectorStore {
12
- upsert(docs: VectorStoreDocument[]): Promise<void>;
13
- query(vector: number[], topK: number): Promise<VectorStoreResult[]>;
14
- delete(ids: string[]): Promise<void>;
15
- }
16
- //# sourceMappingURL=vector-store.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"vector-store.d.ts","sourceRoot":"","sources":["../src/vector-store.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,mBAAmB;IAClC,EAAE,EAAE,MAAM,CAAA;IACV,MAAM,EAAE,MAAM,EAAE,CAAA;IAChB,QAAQ,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;CAClC;AAED,MAAM,WAAW,iBAAiB;IAChC,EAAE,EAAE,MAAM,CAAA;IACV,KAAK,EAAE,MAAM,CAAA;IACb,QAAQ,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;CAClC;AAED,MAAM,WAAW,WAAW;IAC1B,MAAM,CAAC,IAAI,EAAE,mBAAmB,EAAE,GAAG,OAAO,CAAC,IAAI,CAAC,CAAA;IAClD,KAAK,CAAC,MAAM,EAAE,MAAM,EAAE,EAAE,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,iBAAiB,EAAE,CAAC,CAAA;IACnE,MAAM,CAAC,GAAG,EAAE,MAAM,EAAE,GAAG,OAAO,CAAC,IAAI,CAAC,CAAA;CACrC"}