@lumetra/engram-ax 0.1.0
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/LICENSE +21 -0
- package/PRIVACY.md +7 -0
- package/README.md +90 -0
- package/dist/client.d.ts +56 -0
- package/dist/client.d.ts.map +1 -0
- package/dist/client.js +97 -0
- package/dist/client.js.map +1 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +3 -0
- package/dist/index.js.map +1 -0
- package/dist/tools.d.ts +62 -0
- package/dist/tools.d.ts.map +1 -0
- package/dist/tools.js +156 -0
- package/dist/tools.js.map +1 -0
- package/package.json +56 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Lumetra
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/PRIVACY.md
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
# Privacy
|
|
2
|
+
|
|
3
|
+
This adapter sends the parameters you (or your agent) pass to its tools — `content`, `query`, `bucket`, `memory_id` — to the Engram REST API at `https://api.lumetra.io` (or the self-hosted base URL you configured). Memories are stored under your Engram tenant, scoped by the API key you supplied when constructing `EngramClient`.
|
|
4
|
+
|
|
5
|
+
The adapter does not collect, log, or transmit data to any third party other than the Engram service you've explicitly authorized. The adapter does not read other application resources — only the parameters supplied to each tool call.
|
|
6
|
+
|
|
7
|
+
For Engram's own data-handling and retention policy, see <https://lumetra.io/privacy>.
|
package/README.md
ADDED
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
# @lumetra/engram-ax
|
|
2
|
+
|
|
3
|
+
First-party [Engram](https://lumetra.io) memory adapter for the [`@ax-llm/ax`](https://github.com/ax-llm/ax) agent framework.
|
|
4
|
+
|
|
5
|
+
Engram is durable, explainable long-term memory for AI agents. This package exposes Engram's REST API as ax-compatible tool definitions you can drop into any `ax()` generator or agent.
|
|
6
|
+
|
|
7
|
+
## Install
|
|
8
|
+
|
|
9
|
+
```bash
|
|
10
|
+
npm install @lumetra/engram-ax @ax-llm/ax
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
## Quick start
|
|
14
|
+
|
|
15
|
+
```ts
|
|
16
|
+
import { ax, ai } from "@ax-llm/ax";
|
|
17
|
+
import { EngramClient, engramTools } from "@lumetra/engram-ax";
|
|
18
|
+
|
|
19
|
+
const engram = new EngramClient({
|
|
20
|
+
apiKey: process.env.ENGRAM_API_KEY!,
|
|
21
|
+
defaultBucket: "my-app",
|
|
22
|
+
});
|
|
23
|
+
|
|
24
|
+
const llm = ai({ name: "openai", apiKey: process.env.OPENAI_API_KEY! });
|
|
25
|
+
|
|
26
|
+
const assistant = ax(
|
|
27
|
+
"userMessage:string -> reply:string",
|
|
28
|
+
{ functions: engramTools(engram) },
|
|
29
|
+
);
|
|
30
|
+
|
|
31
|
+
const { reply } = await assistant.forward(llm, {
|
|
32
|
+
userMessage: "Remember that I prefer dark mode, then tell me what you know about my preferences.",
|
|
33
|
+
});
|
|
34
|
+
|
|
35
|
+
console.log(reply);
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
## What you get
|
|
39
|
+
|
|
40
|
+
`engramTools(client)` returns ax `AxFunction` definitions for:
|
|
41
|
+
|
|
42
|
+
| Tool | What it does |
|
|
43
|
+
|-----------------|-------------------------------------------------------------------------|
|
|
44
|
+
| `store_memory` | Save a fact / decision / preference to a bucket. |
|
|
45
|
+
| `query_memory` | Retrieve a synthesized answer over memories (semantic + graph search). |
|
|
46
|
+
|
|
47
|
+
By default only those two tools are exposed (the destructive ones are footguns when handed to an LLM). Opt in to more if you need them:
|
|
48
|
+
|
|
49
|
+
```ts
|
|
50
|
+
engramTools(engram, {
|
|
51
|
+
include: [
|
|
52
|
+
"store_memory",
|
|
53
|
+
"query_memory",
|
|
54
|
+
"list_buckets",
|
|
55
|
+
"list_memories",
|
|
56
|
+
"delete_memory",
|
|
57
|
+
"clear_bucket",
|
|
58
|
+
],
|
|
59
|
+
});
|
|
60
|
+
```
|
|
61
|
+
|
|
62
|
+
## Direct REST client
|
|
63
|
+
|
|
64
|
+
You can also use the wrapper directly without ax:
|
|
65
|
+
|
|
66
|
+
```ts
|
|
67
|
+
import { EngramClient } from "@lumetra/engram-ax";
|
|
68
|
+
|
|
69
|
+
const engram = new EngramClient({ apiKey: process.env.ENGRAM_API_KEY! });
|
|
70
|
+
|
|
71
|
+
await engram.storeMemory("Jacob prefers dark mode", "prefs");
|
|
72
|
+
const { answer } = await engram.queryMemory("What UI mode does Jacob like?", "prefs");
|
|
73
|
+
```
|
|
74
|
+
|
|
75
|
+
Methods: `storeMemory`, `queryMemory`, `listBuckets`, `listMemories`, `deleteMemory`, `clearBucket`.
|
|
76
|
+
|
|
77
|
+
## Configuration
|
|
78
|
+
|
|
79
|
+
`EngramClient` accepts:
|
|
80
|
+
|
|
81
|
+
- `apiKey` — your Engram API key (`eng_live_...`). Required.
|
|
82
|
+
- `baseUrl` — defaults to `https://api.lumetra.io`. Override for self-hosted.
|
|
83
|
+
- `defaultBucket` — used when a tool call omits `bucket`. Defaults to `"default"`.
|
|
84
|
+
- `fetch` — optional custom `fetch` implementation.
|
|
85
|
+
|
|
86
|
+
## License
|
|
87
|
+
|
|
88
|
+
MIT — Lumetra.
|
|
89
|
+
|
|
90
|
+
See [PRIVACY.md](./PRIVACY.md).
|
package/dist/client.d.ts
ADDED
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* EngramClient — minimal REST wrapper around the Engram memory API.
|
|
3
|
+
*
|
|
4
|
+
* Auth: Bearer token (e.g. `eng_live_...`). Base URL defaults to
|
|
5
|
+
* `https://api.lumetra.io` but can be overridden for self-hosted deployments.
|
|
6
|
+
*/
|
|
7
|
+
export interface EngramClientOptions {
|
|
8
|
+
/** Engram API key (Bearer token). */
|
|
9
|
+
apiKey: string;
|
|
10
|
+
/** Base URL of the Engram API. Defaults to `https://api.lumetra.io`. */
|
|
11
|
+
baseUrl?: string;
|
|
12
|
+
/** Default bucket to use when the caller does not specify one. */
|
|
13
|
+
defaultBucket?: string;
|
|
14
|
+
/** Optional `fetch` implementation. Defaults to global `fetch`. */
|
|
15
|
+
fetch?: typeof fetch;
|
|
16
|
+
}
|
|
17
|
+
export interface EngramQueryResponse {
|
|
18
|
+
success: boolean;
|
|
19
|
+
answer?: string;
|
|
20
|
+
[k: string]: unknown;
|
|
21
|
+
}
|
|
22
|
+
export interface EngramBucket {
|
|
23
|
+
name: string;
|
|
24
|
+
[k: string]: unknown;
|
|
25
|
+
}
|
|
26
|
+
export interface EngramMemory {
|
|
27
|
+
id: string;
|
|
28
|
+
content?: string;
|
|
29
|
+
[k: string]: unknown;
|
|
30
|
+
}
|
|
31
|
+
export declare class EngramError extends Error {
|
|
32
|
+
status: number;
|
|
33
|
+
body: unknown;
|
|
34
|
+
constructor(message: string, status: number, body: unknown);
|
|
35
|
+
}
|
|
36
|
+
export declare class EngramClient {
|
|
37
|
+
readonly baseUrl: string;
|
|
38
|
+
readonly defaultBucket: string;
|
|
39
|
+
private readonly apiKey;
|
|
40
|
+
private readonly fetchImpl;
|
|
41
|
+
constructor(opts: EngramClientOptions);
|
|
42
|
+
private request;
|
|
43
|
+
/** Store a memory in the given bucket. */
|
|
44
|
+
storeMemory(content: string, bucket?: string): Promise<unknown>;
|
|
45
|
+
/** Query memories — Engram returns a synthesized `answer` string. */
|
|
46
|
+
queryMemory(query: string, bucket?: string): Promise<EngramQueryResponse>;
|
|
47
|
+
/** List buckets on the tenant. */
|
|
48
|
+
listBuckets(limit?: number, offset?: number): Promise<unknown>;
|
|
49
|
+
/** List memories in a bucket. */
|
|
50
|
+
listMemories(bucket?: string, limit?: number): Promise<unknown>;
|
|
51
|
+
/** Delete a single memory by id. */
|
|
52
|
+
deleteMemory(memoryId: string, bucket?: string): Promise<unknown>;
|
|
53
|
+
/** Clear every memory in a bucket. Destructive. */
|
|
54
|
+
clearBucket(bucket?: string): Promise<unknown>;
|
|
55
|
+
}
|
|
56
|
+
//# sourceMappingURL=client.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../src/client.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,MAAM,WAAW,mBAAmB;IAClC,qCAAqC;IACrC,MAAM,EAAE,MAAM,CAAC;IACf,wEAAwE;IACxE,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,kEAAkE;IAClE,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,mEAAmE;IACnE,KAAK,CAAC,EAAE,OAAO,KAAK,CAAC;CACtB;AAED,MAAM,WAAW,mBAAmB;IAClC,OAAO,EAAE,OAAO,CAAC;IACj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,MAAM,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC;IAQvE,mDAAmD;IAC7C,WAAW,CAAC,MAAM,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC;CAOrD"}
|
package/dist/client.js
ADDED
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* EngramClient — minimal REST wrapper around the Engram memory API.
|
|
3
|
+
*
|
|
4
|
+
* Auth: Bearer token (e.g. `eng_live_...`). Base URL defaults to
|
|
5
|
+
* `https://api.lumetra.io` but can be overridden for self-hosted deployments.
|
|
6
|
+
*/
|
|
7
|
+
export class EngramError extends Error {
|
|
8
|
+
status;
|
|
9
|
+
body;
|
|
10
|
+
constructor(message, status, body) {
|
|
11
|
+
super(message);
|
|
12
|
+
this.name = "EngramError";
|
|
13
|
+
this.status = status;
|
|
14
|
+
this.body = body;
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
export class EngramClient {
|
|
18
|
+
baseUrl;
|
|
19
|
+
defaultBucket;
|
|
20
|
+
apiKey;
|
|
21
|
+
fetchImpl;
|
|
22
|
+
constructor(opts) {
|
|
23
|
+
if (!opts.apiKey)
|
|
24
|
+
throw new Error("EngramClient: apiKey is required");
|
|
25
|
+
this.apiKey = opts.apiKey;
|
|
26
|
+
this.baseUrl = (opts.baseUrl ?? "https://api.lumetra.io").replace(/\/+$/, "");
|
|
27
|
+
this.defaultBucket = opts.defaultBucket ?? "default";
|
|
28
|
+
const f = opts.fetch ?? globalThis.fetch;
|
|
29
|
+
if (!f) {
|
|
30
|
+
throw new Error("EngramClient: no fetch implementation available. Pass `fetch` in options or run on Node >=18.");
|
|
31
|
+
}
|
|
32
|
+
this.fetchImpl = f.bind(globalThis);
|
|
33
|
+
}
|
|
34
|
+
async request(method, path, body) {
|
|
35
|
+
const url = `${this.baseUrl}${path}`;
|
|
36
|
+
const headers = {
|
|
37
|
+
Authorization: `Bearer ${this.apiKey}`,
|
|
38
|
+
Accept: "application/json",
|
|
39
|
+
};
|
|
40
|
+
if (body !== undefined)
|
|
41
|
+
headers["Content-Type"] = "application/json";
|
|
42
|
+
const res = await this.fetchImpl(url, {
|
|
43
|
+
method,
|
|
44
|
+
headers,
|
|
45
|
+
body: body !== undefined ? JSON.stringify(body) : undefined,
|
|
46
|
+
});
|
|
47
|
+
const text = await res.text();
|
|
48
|
+
let parsed = undefined;
|
|
49
|
+
if (text) {
|
|
50
|
+
try {
|
|
51
|
+
parsed = JSON.parse(text);
|
|
52
|
+
}
|
|
53
|
+
catch {
|
|
54
|
+
parsed = text;
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
if (!res.ok) {
|
|
58
|
+
throw new EngramError(`Engram ${method} ${path} failed: ${res.status} ${res.statusText}`, res.status, parsed);
|
|
59
|
+
}
|
|
60
|
+
return parsed;
|
|
61
|
+
}
|
|
62
|
+
/** Store a memory in the given bucket. */
|
|
63
|
+
async storeMemory(content, bucket) {
|
|
64
|
+
const b = bucket ?? this.defaultBucket;
|
|
65
|
+
return this.request("POST", `/v1/buckets/${encodeURIComponent(b)}/memories`, {
|
|
66
|
+
content,
|
|
67
|
+
});
|
|
68
|
+
}
|
|
69
|
+
/** Query memories — Engram returns a synthesized `answer` string. */
|
|
70
|
+
async queryMemory(query, bucket) {
|
|
71
|
+
const b = bucket ?? this.defaultBucket;
|
|
72
|
+
return this.request("POST", `/v1/query`, {
|
|
73
|
+
query,
|
|
74
|
+
bucket: b,
|
|
75
|
+
});
|
|
76
|
+
}
|
|
77
|
+
/** List buckets on the tenant. */
|
|
78
|
+
async listBuckets(limit = 50, offset = 0) {
|
|
79
|
+
return this.request("GET", `/v1/buckets?limit=${limit}&offset=${offset}`);
|
|
80
|
+
}
|
|
81
|
+
/** List memories in a bucket. */
|
|
82
|
+
async listMemories(bucket, limit = 50) {
|
|
83
|
+
const b = bucket ?? this.defaultBucket;
|
|
84
|
+
return this.request("GET", `/v1/buckets/${encodeURIComponent(b)}/memories?limit=${limit}`);
|
|
85
|
+
}
|
|
86
|
+
/** Delete a single memory by id. */
|
|
87
|
+
async deleteMemory(memoryId, bucket) {
|
|
88
|
+
const b = bucket ?? this.defaultBucket;
|
|
89
|
+
return this.request("DELETE", `/v1/buckets/${encodeURIComponent(b)}/memories/${encodeURIComponent(memoryId)}`);
|
|
90
|
+
}
|
|
91
|
+
/** Clear every memory in a bucket. Destructive. */
|
|
92
|
+
async clearBucket(bucket) {
|
|
93
|
+
const b = bucket ?? this.defaultBucket;
|
|
94
|
+
return this.request("DELETE", `/v1/buckets/${encodeURIComponent(b)}/memories`);
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
//# sourceMappingURL=client.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"client.js","sourceRoot":"","sources":["../src/client.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AA8BH,MAAM,OAAO,WAAY,SAAQ,KAAK;IACpC,MAAM,CAAS;IACf,IAAI,CAAU;IACd,YAAY,OAAe,EAAE,MAAc,EAAE,IAAa;QACxD,KAAK,CAAC,OAAO,CAAC,CAAC;QACf,IAAI,CAAC,IAAI,GAAG,aAAa,CAAC;QAC1B,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;QACrB,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC;IACnB,CAAC;CACF;AAED,MAAM,OAAO,YAAY;IACd,OAAO,CAAS;IAChB,aAAa,CAAS;IACd,MAAM,CAAS;IACf,SAAS,CAAe;IAEzC,YAAY,IAAyB;QACnC,IAAI,CAAC,IAAI,CAAC,MAAM;YAAE,MAAM,IAAI,KAAK,CAAC,kCAAkC,CAAC,CAAC;QACtE,IAAI,CAAC,MAAM,GAAG,IAAI,CAAC,MAAM,CAAC;QAC1B,IAAI,CAAC,OAAO,GAAG,CAAC,IAAI,CAAC,OAAO,IAAI,wBAAwB,CAAC,CAAC,OAAO,CAAC,MAAM,EAAE,EAAE,CAAC,CAAC;QAC9E,IAAI,CAAC,aAA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AO,IAAI,CAAC,OAAO,CACjB,QAAQ,EACR,eAAe,kBAAkB,CAAC,CAAC,CAAC,aAAa,kBAAkB,CAAC,QAAQ,CAAC,EAAE,CAChF,CAAC;IACJ,CAAC;IAED,mDAAmD;IACnD,KAAK,CAAC,WAAW,CAAC,MAAe;QAC/B,MAAM,CAAC,GAAG,MAAM,IAAI,IAAI,CAAC,aAAa,CAAC;QACvC,OAAO,IAAI,CAAC,OAAO,CACjB,QAAQ,EACR,eAAe,kBAAkB,CAAC,CAAC,CAAC,WAAW,CAChD,CAAC;IACJ,CAAC;CACF"}
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
export { EngramClient, EngramError, type EngramClientOptions, type EngramQueryResponse, type EngramBucket, type EngramMemory, } from "./client.js";
|
|
2
|
+
export { engramTools, type EngramAxFunction, type EngramJSONSchemaProperty, type EngramToolsOptions, } from "./tools.js";
|
|
3
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,YAAY,EACZ,WAAW,EACX,KAAK,mBAAmB,EACxB,KAAK,mBAAmB,EACxB,KAAK,YAAY,EACjB,KAAK,YAAY,GAClB,MAAM,aAAa,CAAC;AAErB,OAAO,EACL,WAAW,EACX,KAAK,gBAAgB,EACrB,KAAK,wBAAwB,EAC7B,KAAK,kBAAkB,GACxB,MAAM,YAAY,CAAC"}
|
package/dist/index.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,YAAY,EACZ,WAAW,GAKZ,MAAM,aAAa,CAAC;AAErB,OAAO,EACL,WAAW,GAIZ,MAAM,YAAY,CAAC"}
|
package/dist/tools.d.ts
ADDED
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Ax-compatible tool definitions for Engram.
|
|
3
|
+
*
|
|
4
|
+
* These follow the canonical `AxFunction` shape used by `@ax-llm/ax`:
|
|
5
|
+
*
|
|
6
|
+
* { name, description, parameters (JSON Schema), func }
|
|
7
|
+
*
|
|
8
|
+
* The shape is intentionally a plain object (rather than the `fn()` builder)
|
|
9
|
+
* so the package has zero hard dependency on `@ax-llm/ax` — consumers pass
|
|
10
|
+
* the returned objects straight into `ax(..., { functions })` or
|
|
11
|
+
* `agent(..., { functions })`.
|
|
12
|
+
*/
|
|
13
|
+
import type { EngramClient } from "./client.js";
|
|
14
|
+
/**
|
|
15
|
+
* Minimal structural type matching `AxFunction` from `@ax-llm/ax` without
|
|
16
|
+
* importing it (kept as a peer dep). The real type lives at
|
|
17
|
+
* `@ax-llm/ax`'s `src/ai/types.ts`.
|
|
18
|
+
*/
|
|
19
|
+
/**
|
|
20
|
+
* JSON Schema shape compatible with ax's `AxFunctionJSONSchema`.
|
|
21
|
+
* Each property carries a required `description` (ax enforces this).
|
|
22
|
+
*/
|
|
23
|
+
export interface EngramJSONSchemaProperty {
|
|
24
|
+
type: string;
|
|
25
|
+
description: string;
|
|
26
|
+
enum?: string[];
|
|
27
|
+
items?: EngramJSONSchemaProperty;
|
|
28
|
+
}
|
|
29
|
+
export interface EngramAxFunction {
|
|
30
|
+
name: string;
|
|
31
|
+
description: string;
|
|
32
|
+
parameters: {
|
|
33
|
+
type: "object";
|
|
34
|
+
properties: Record<string, EngramJSONSchemaProperty>;
|
|
35
|
+
required?: string[];
|
|
36
|
+
};
|
|
37
|
+
func: (args?: unknown) => Promise<unknown>;
|
|
38
|
+
}
|
|
39
|
+
export interface EngramToolsOptions {
|
|
40
|
+
/**
|
|
41
|
+
* Restrict which Engram tools are exposed to the agent. Defaults to the
|
|
42
|
+
* two write/read tools (`store_memory`, `query_memory`) since exposing the
|
|
43
|
+
* destructive ops to an LLM is usually a footgun.
|
|
44
|
+
*/
|
|
45
|
+
include?: Array<"store_memory" | "query_memory" | "list_buckets" | "list_memories" | "delete_memory" | "clear_bucket">;
|
|
46
|
+
}
|
|
47
|
+
/**
|
|
48
|
+
* Build ax-compatible tool definitions backed by an `EngramClient`.
|
|
49
|
+
*
|
|
50
|
+
* @example
|
|
51
|
+
* ```ts
|
|
52
|
+
* import { ax } from "@ax-llm/ax";
|
|
53
|
+
* import { EngramClient, engramTools } from "@lumetra/engram-ax";
|
|
54
|
+
*
|
|
55
|
+
* const client = new EngramClient({ apiKey: process.env.ENGRAM_API_KEY! });
|
|
56
|
+
* const agent = ax("question:string -> answer:string", {
|
|
57
|
+
* functions: engramTools(client),
|
|
58
|
+
* });
|
|
59
|
+
* ```
|
|
60
|
+
*/
|
|
61
|
+
export declare function engramTools(client: EngramClient, opts?: EngramToolsOptions): EngramAxFunction[];
|
|
62
|
+
//# sourceMappingURL=tools.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tools.d.ts","sourceRoot":"","sources":["../src/tools.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAEH,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAEhD;;;;GAIG;AACH;;;GAGG;AACH,MAAM,WAAW,wBAAwB;IACvC,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,EAAE,MAAM,CAAC;IACpB,IAAI,CAAC,EAAE,MAAM,EAAE,CAAC;IAChB,KAAK,CAAC,EAAE,wBAAwB,CAAC;CAClC;AAED,MAAM,WAAW,gBAAgB;IAC/B,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,EAAE,MAAM,CAAC;IACpB,UAAU,EAAE;QACV,IAAI,EAAE,QAAQ,CAAC;QACf,UAAU,EAAE,MAAM,CAAC,MAAM,EAAE,wBAAwB,CAAC,CAAC;QACrD,QAAQ,CAAC,EAAE,MAAM,EAAE,CAAC;KACrB,CAAC;IACF,IAAI,EAAE,CAAC,IAAI,CAAC,EAAE,OAAO,KAAK,OAAO,CAAC,OAAO,CAAC,CAAC;CAC5C;AAED,MAAM,WAAW,kBAAkB;IACjC;;;;OAIG;IACH,OAAO,CAAC,EAAE,KAAK,CACX,cAAc,GACd,cAAc,GACd,cAAc,GACd,eAAe,GACf,eAAe,GACf,cAAc,CACjB,CAAC;CACH;AAOD;;;;;;;;;;;;;GAaG;AACH,wBAAgB,WAAW,CACzB,MAAM,EAAE,YAAY,EACpB,IAAI,GAAE,kBAAuB,GAC5B,gBAAgB,EAAE,CA8IpB"}
|
package/dist/tools.js
ADDED
|
@@ -0,0 +1,156 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Ax-compatible tool definitions for Engram.
|
|
3
|
+
*
|
|
4
|
+
* These follow the canonical `AxFunction` shape used by `@ax-llm/ax`:
|
|
5
|
+
*
|
|
6
|
+
* { name, description, parameters (JSON Schema), func }
|
|
7
|
+
*
|
|
8
|
+
* The shape is intentionally a plain object (rather than the `fn()` builder)
|
|
9
|
+
* so the package has zero hard dependency on `@ax-llm/ax` — consumers pass
|
|
10
|
+
* the returned objects straight into `ax(..., { functions })` or
|
|
11
|
+
* `agent(..., { functions })`.
|
|
12
|
+
*/
|
|
13
|
+
const DEFAULT_INCLUDE = [
|
|
14
|
+
"store_memory",
|
|
15
|
+
"query_memory",
|
|
16
|
+
];
|
|
17
|
+
/**
|
|
18
|
+
* Build ax-compatible tool definitions backed by an `EngramClient`.
|
|
19
|
+
*
|
|
20
|
+
* @example
|
|
21
|
+
* ```ts
|
|
22
|
+
* import { ax } from "@ax-llm/ax";
|
|
23
|
+
* import { EngramClient, engramTools } from "@lumetra/engram-ax";
|
|
24
|
+
*
|
|
25
|
+
* const client = new EngramClient({ apiKey: process.env.ENGRAM_API_KEY! });
|
|
26
|
+
* const agent = ax("question:string -> answer:string", {
|
|
27
|
+
* functions: engramTools(client),
|
|
28
|
+
* });
|
|
29
|
+
* ```
|
|
30
|
+
*/
|
|
31
|
+
export function engramTools(client, opts = {}) {
|
|
32
|
+
const include = new Set(opts.include ?? DEFAULT_INCLUDE);
|
|
33
|
+
const all = {
|
|
34
|
+
store_memory: {
|
|
35
|
+
name: "store_memory",
|
|
36
|
+
description: "Save a fact, decision, or piece of context to Engram durable memory. " +
|
|
37
|
+
"Use this when the user shares a fact, preference, or important detail " +
|
|
38
|
+
"you'll want to recall later.",
|
|
39
|
+
parameters: {
|
|
40
|
+
type: "object",
|
|
41
|
+
properties: {
|
|
42
|
+
content: {
|
|
43
|
+
type: "string",
|
|
44
|
+
description: "The fact or context to remember. One concept per call works best.",
|
|
45
|
+
},
|
|
46
|
+
bucket: {
|
|
47
|
+
type: "string",
|
|
48
|
+
description: "Optional bucket name to scope the memory. Defaults to the client's default bucket.",
|
|
49
|
+
},
|
|
50
|
+
},
|
|
51
|
+
required: ["content"],
|
|
52
|
+
},
|
|
53
|
+
func: async (args) => {
|
|
54
|
+
const { content, bucket } = (args ?? {});
|
|
55
|
+
if (!content)
|
|
56
|
+
throw new Error("store_memory: `content` is required");
|
|
57
|
+
await client.storeMemory(content, bucket);
|
|
58
|
+
return { ok: true };
|
|
59
|
+
},
|
|
60
|
+
},
|
|
61
|
+
query_memory: {
|
|
62
|
+
name: "query_memory",
|
|
63
|
+
description: "Search Engram durable memory for facts and context relevant to a " +
|
|
64
|
+
"question. Returns a synthesized answer string. Call this BEFORE " +
|
|
65
|
+
"answering whenever the user might be referring to prior context.",
|
|
66
|
+
parameters: {
|
|
67
|
+
type: "object",
|
|
68
|
+
properties: {
|
|
69
|
+
query: {
|
|
70
|
+
type: "string",
|
|
71
|
+
description: "Natural-language question to search memory for.",
|
|
72
|
+
},
|
|
73
|
+
bucket: {
|
|
74
|
+
type: "string",
|
|
75
|
+
description: "Optional bucket name to search. Defaults to the client's default bucket.",
|
|
76
|
+
},
|
|
77
|
+
},
|
|
78
|
+
required: ["query"],
|
|
79
|
+
},
|
|
80
|
+
func: async (args) => {
|
|
81
|
+
const { query, bucket } = (args ?? {});
|
|
82
|
+
if (!query)
|
|
83
|
+
throw new Error("query_memory: `query` is required");
|
|
84
|
+
const res = await client.queryMemory(query, bucket);
|
|
85
|
+
return { answer: res.answer ?? "", success: res.success ?? true };
|
|
86
|
+
},
|
|
87
|
+
},
|
|
88
|
+
list_buckets: {
|
|
89
|
+
name: "list_buckets",
|
|
90
|
+
description: "List Engram memory buckets on the current tenant.",
|
|
91
|
+
parameters: {
|
|
92
|
+
type: "object",
|
|
93
|
+
properties: {
|
|
94
|
+
limit: { type: "number", description: "Max buckets to return (default 50)." },
|
|
95
|
+
offset: { type: "number", description: "Pagination offset (default 0)." },
|
|
96
|
+
},
|
|
97
|
+
},
|
|
98
|
+
func: async (args) => {
|
|
99
|
+
const { limit, offset } = (args ?? {});
|
|
100
|
+
return client.listBuckets(limit, offset);
|
|
101
|
+
},
|
|
102
|
+
},
|
|
103
|
+
list_memories: {
|
|
104
|
+
name: "list_memories",
|
|
105
|
+
description: "List recent memories in an Engram bucket.",
|
|
106
|
+
parameters: {
|
|
107
|
+
type: "object",
|
|
108
|
+
properties: {
|
|
109
|
+
bucket: { type: "string", description: "Bucket name." },
|
|
110
|
+
limit: { type: "number", description: "Max memories to return (default 50)." },
|
|
111
|
+
},
|
|
112
|
+
},
|
|
113
|
+
func: async (args) => {
|
|
114
|
+
const { bucket, limit } = (args ?? {});
|
|
115
|
+
return client.listMemories(bucket, limit);
|
|
116
|
+
},
|
|
117
|
+
},
|
|
118
|
+
delete_memory: {
|
|
119
|
+
name: "delete_memory",
|
|
120
|
+
description: "Delete a single Engram memory by id. Destructive.",
|
|
121
|
+
parameters: {
|
|
122
|
+
type: "object",
|
|
123
|
+
properties: {
|
|
124
|
+
memory_id: { type: "string", description: "Memory id to delete." },
|
|
125
|
+
bucket: { type: "string", description: "Bucket the memory lives in." },
|
|
126
|
+
},
|
|
127
|
+
required: ["memory_id"],
|
|
128
|
+
},
|
|
129
|
+
func: async (args) => {
|
|
130
|
+
const { memory_id, bucket } = (args ?? {});
|
|
131
|
+
if (!memory_id)
|
|
132
|
+
throw new Error("delete_memory: `memory_id` is required");
|
|
133
|
+
await client.deleteMemory(memory_id, bucket);
|
|
134
|
+
return { ok: true };
|
|
135
|
+
},
|
|
136
|
+
},
|
|
137
|
+
clear_bucket: {
|
|
138
|
+
name: "clear_bucket",
|
|
139
|
+
description: "Delete EVERY memory in an Engram bucket. Highly destructive — do not " +
|
|
140
|
+
"call this unless the user has explicitly asked to wipe the bucket.",
|
|
141
|
+
parameters: {
|
|
142
|
+
type: "object",
|
|
143
|
+
properties: {
|
|
144
|
+
bucket: { type: "string", description: "Bucket to wipe." },
|
|
145
|
+
},
|
|
146
|
+
},
|
|
147
|
+
func: async (args) => {
|
|
148
|
+
const { bucket } = (args ?? {});
|
|
149
|
+
await client.clearBucket(bucket);
|
|
150
|
+
return { ok: true };
|
|
151
|
+
},
|
|
152
|
+
},
|
|
153
|
+
};
|
|
154
|
+
return Object.values(all).filter((t) => include.has(t.name));
|
|
155
|
+
}
|
|
156
|
+
//# sourceMappingURL=tools.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tools.js","sourceRoot":"","sources":["../src/tools.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AA+CH,MAAM,eAAe,GAA+C;IAClE,cAAc;IACd,cAAc;CACf,CAAC;AAEF;;;;;;;;;;;;;GAaG;AACH,MAAM,UAAU,WAAW,CACzB,MAAoB,EACpB,OAA2B,EAAE;IAE7B,MAAM,OAAO,GAAG,IAAI,GAAG,CAAC,IAAI,CAAC,OAAO,IAAI,eAAe,CAAC,CAAC;IAEzD,MAAM,GAAG,GAAqC;QAC5C,YAAY,EAAE;YACZ,IAAI,EAAE,cAAc;YACpB,WAAW,EACT,uEAAuE;gBACvE,wEAAwE;gBACxE,8BAA8B;YAChC,UAAU,EAAE;gBACV,IAAI,EAAE,QAAQ;gBACd,UAAU,EAAE;oBACV,OAAO,EAAE;wBACP,IAAI,EAAE,QAAQ;wBACd,WAAW,EAAE,mEAAmE;qBACjF;oBACD,MAAM,E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ra/engram-ax",
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"description": "Engram memory adapter for the ax (@ax-llm/ax) agent framework.",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"main": "dist/index.js",
|
|
7
|
+
"module": "dist/index.js",
|
|
8
|
+
"types": "dist/index.d.ts",
|
|
9
|
+
"exports": {
|
|
10
|
+
".": {
|
|
11
|
+
"types": "./dist/index.d.ts",
|
|
12
|
+
"import": "./dist/index.js"
|
|
13
|
+
}
|
|
14
|
+
},
|
|
15
|
+
"files": [
|
|
16
|
+
"dist",
|
|
17
|
+
"README.md",
|
|
18
|
+
"PRIVACY.md",
|
|
19
|
+
"LICENSE"
|
|
20
|
+
],
|
|
21
|
+
"scripts": {
|
|
22
|
+
"build": "tsc",
|
|
23
|
+
"prepublishOnly": "npm run build"
|
|
24
|
+
},
|
|
25
|
+
"keywords": [
|
|
26
|
+
"engram",
|
|
27
|
+
"lumetra",
|
|
28
|
+
"ax",
|
|
29
|
+
"ax-llm",
|
|
30
|
+
"memory",
|
|
31
|
+
"agent",
|
|
32
|
+
"llm"
|
|
33
|
+
],
|
|
34
|
+
"author": "Lumetra",
|
|
35
|
+
"license": "MIT",
|
|
36
|
+
"repository": {
|
|
37
|
+
"type": "git",
|
|
38
|
+
"url": "https://github.com/lumetra-io/engram-ax"
|
|
39
|
+
},
|
|
40
|
+
"homepage": "https://lumetra.io",
|
|
41
|
+
"peerDependencies": {
|
|
42
|
+
"@ax-llm/ax": ">=13.0.0 <16.0.0"
|
|
43
|
+
},
|
|
44
|
+
"peerDependenciesMeta": {
|
|
45
|
+
"@ax-llm/ax": {
|
|
46
|
+
"optional": true
|
|
47
|
+
}
|
|
48
|
+
},
|
|
49
|
+
"devDependencies": {
|
|
50
|
+
"@ax-llm/ax": "^14.0.0",
|
|
51
|
+
"typescript": "^5.5.0"
|
|
52
|
+
},
|
|
53
|
+
"engines": {
|
|
54
|
+
"node": ">=18"
|
|
55
|
+
}
|
|
56
|
+
}
|