@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 +27 -7
- package/package.json +12 -3
- package/dist/file-vector.d.ts +0 -8
- package/dist/file-vector.d.ts.map +0 -1
- package/dist/index.d.ts.map +0 -1
- package/dist/redis-chat.d.ts +0 -8
- package/dist/redis-chat.d.ts.map +0 -1
- package/dist/redis-client.d.ts +0 -19
- package/dist/redis-client.d.ts.map +0 -1
- package/dist/redis-vector.d.ts +0 -9
- package/dist/redis-vector.d.ts.map +0 -1
- package/dist/sqlite.d.ts +0 -7
- package/dist/sqlite.d.ts.map +0 -1
- package/dist/vector-store.d.ts +0 -16
- package/dist/vector-store.d.ts.map +0 -1
package/README.md
CHANGED
|
@@ -1,14 +1,22 @@
|
|
|
1
1
|
# @agentskit/memory
|
|
2
2
|
|
|
3
|
-

|
|
4
|
-
|
|
5
3
|
Persist conversations and add vector search to your agents — swap backends without changing agent code.
|
|
6
4
|
|
|
7
|
-
|
|
5
|
+
[](https://www.npmjs.com/package/@agentskit/memory)
|
|
6
|
+
[](https://www.npmjs.com/package/@agentskit/memory)
|
|
7
|
+
[](https://bundlephobia.com/package/@agentskit/memory)
|
|
8
|
+
[](../../LICENSE)
|
|
9
|
+
[](../../docs/STABILITY.md)
|
|
10
|
+
[](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
|
-
##
|
|
50
|
+
## Features
|
|
43
51
|
|
|
44
|
-
-
|
|
45
|
-
-
|
|
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://
|
|
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.
|
|
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.
|
|
43
|
+
"@agentskit/core": "1.1.0"
|
|
35
44
|
},
|
|
36
45
|
"devDependencies": {
|
|
37
46
|
"@types/better-sqlite3": "^7.6.12",
|
package/dist/file-vector.d.ts
DELETED
|
@@ -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"}
|
package/dist/index.d.ts.map
DELETED
|
@@ -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"}
|
package/dist/redis-chat.d.ts
DELETED
|
@@ -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
|
package/dist/redis-chat.d.ts.map
DELETED
|
@@ -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"}
|
package/dist/redis-client.d.ts
DELETED
|
@@ -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"}
|
package/dist/redis-vector.d.ts
DELETED
|
@@ -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
|
package/dist/sqlite.d.ts.map
DELETED
|
@@ -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"}
|
package/dist/vector-store.d.ts
DELETED
|
@@ -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"}
|