@waynesutton/agent-memory 0.0.1
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/.claude/settings.json +9 -0
- package/.claude/settings.local.json +7 -0
- package/AGENTS.md +113 -0
- package/CLAUDE.md +79 -0
- package/README.md +1 -0
- package/dist/cli/index.d.ts +3 -0
- package/dist/cli/index.d.ts.map +1 -0
- package/dist/cli/index.js +192 -0
- package/dist/cli/index.js.map +1 -0
- package/dist/cli/parsers/claude-code.d.ts +3 -0
- package/dist/cli/parsers/claude-code.d.ts.map +1 -0
- package/dist/cli/parsers/claude-code.js +75 -0
- package/dist/cli/parsers/claude-code.js.map +1 -0
- package/dist/cli/parsers/codex.d.ts +3 -0
- package/dist/cli/parsers/codex.d.ts.map +1 -0
- package/dist/cli/parsers/codex.js +42 -0
- package/dist/cli/parsers/codex.js.map +1 -0
- package/dist/cli/parsers/conductor.d.ts +3 -0
- package/dist/cli/parsers/conductor.d.ts.map +1 -0
- package/dist/cli/parsers/conductor.js +43 -0
- package/dist/cli/parsers/conductor.js.map +1 -0
- package/dist/cli/parsers/cursor.d.ts +3 -0
- package/dist/cli/parsers/cursor.d.ts.map +1 -0
- package/dist/cli/parsers/cursor.js +50 -0
- package/dist/cli/parsers/cursor.js.map +1 -0
- package/dist/cli/parsers/index.d.ts +12 -0
- package/dist/cli/parsers/index.d.ts.map +1 -0
- package/dist/cli/parsers/index.js +27 -0
- package/dist/cli/parsers/index.js.map +1 -0
- package/dist/cli/parsers/opencode.d.ts +3 -0
- package/dist/cli/parsers/opencode.d.ts.map +1 -0
- package/dist/cli/parsers/opencode.js +72 -0
- package/dist/cli/parsers/opencode.js.map +1 -0
- package/dist/cli/parsers/parsers.test.d.ts +2 -0
- package/dist/cli/parsers/parsers.test.d.ts.map +1 -0
- package/dist/cli/parsers/parsers.test.js +151 -0
- package/dist/cli/parsers/parsers.test.js.map +1 -0
- package/dist/cli/parsers/pi.d.ts +3 -0
- package/dist/cli/parsers/pi.d.ts.map +1 -0
- package/dist/cli/parsers/pi.js +43 -0
- package/dist/cli/parsers/pi.js.map +1 -0
- package/dist/cli/parsers/types.d.ts +25 -0
- package/dist/cli/parsers/types.d.ts.map +1 -0
- package/dist/cli/parsers/types.js +2 -0
- package/dist/cli/parsers/types.js.map +1 -0
- package/dist/cli/parsers/vscode-copilot.d.ts +3 -0
- package/dist/cli/parsers/vscode-copilot.d.ts.map +1 -0
- package/dist/cli/parsers/vscode-copilot.js +69 -0
- package/dist/cli/parsers/vscode-copilot.js.map +1 -0
- package/dist/cli/parsers/zed.d.ts +3 -0
- package/dist/cli/parsers/zed.d.ts.map +1 -0
- package/dist/cli/parsers/zed.js +43 -0
- package/dist/cli/parsers/zed.js.map +1 -0
- package/dist/cli/sync.d.ts +21 -0
- package/dist/cli/sync.d.ts.map +1 -0
- package/dist/cli/sync.js +78 -0
- package/dist/cli/sync.js.map +1 -0
- package/dist/cli/type-extractor.d.ts +25 -0
- package/dist/cli/type-extractor.d.ts.map +1 -0
- package/dist/cli/type-extractor.js +254 -0
- package/dist/cli/type-extractor.js.map +1 -0
- package/dist/cli/type-extractor.test.d.ts +2 -0
- package/dist/cli/type-extractor.test.d.ts.map +1 -0
- package/dist/cli/type-extractor.test.js +173 -0
- package/dist/cli/type-extractor.test.js.map +1 -0
- package/dist/client/http.d.ts +44 -0
- package/dist/client/http.d.ts.map +1 -0
- package/dist/client/http.js +311 -0
- package/dist/client/http.js.map +1 -0
- package/dist/client/index.d.ts +158 -0
- package/dist/client/index.d.ts.map +1 -0
- package/dist/client/index.js +256 -0
- package/dist/client/index.js.map +1 -0
- package/dist/component/_generated/api.d.ts +12 -0
- package/dist/component/_generated/api.d.ts.map +1 -0
- package/dist/component/_generated/api.js +13 -0
- package/dist/component/_generated/api.js.map +1 -0
- package/dist/component/_generated/dataModel.d.ts +18 -0
- package/dist/component/_generated/dataModel.d.ts.map +1 -0
- package/dist/component/_generated/dataModel.js +11 -0
- package/dist/component/_generated/dataModel.js.map +1 -0
- package/dist/component/_generated/server.d.ts +42 -0
- package/dist/component/_generated/server.d.ts.map +1 -0
- package/dist/component/_generated/server.js +39 -0
- package/dist/component/_generated/server.js.map +1 -0
- package/dist/component/actions.d.ts +42 -0
- package/dist/component/actions.d.ts.map +1 -0
- package/dist/component/actions.js +405 -0
- package/dist/component/actions.js.map +1 -0
- package/dist/component/apiKeyMutations.d.ts +29 -0
- package/dist/component/apiKeyMutations.d.ts.map +1 -0
- package/dist/component/apiKeyMutations.js +149 -0
- package/dist/component/apiKeyMutations.js.map +1 -0
- package/dist/component/apiKeyQueries.d.ts +37 -0
- package/dist/component/apiKeyQueries.d.ts.map +1 -0
- package/dist/component/apiKeyQueries.js +127 -0
- package/dist/component/apiKeyQueries.js.map +1 -0
- package/dist/component/checksum.d.ts +6 -0
- package/dist/component/checksum.d.ts.map +1 -0
- package/dist/component/checksum.js +14 -0
- package/dist/component/checksum.js.map +1 -0
- package/dist/component/checksum.test.d.ts +2 -0
- package/dist/component/checksum.test.d.ts.map +1 -0
- package/dist/component/checksum.test.js +27 -0
- package/dist/component/checksum.test.js.map +1 -0
- package/dist/component/convex.config.d.ts +3 -0
- package/dist/component/convex.config.d.ts.map +1 -0
- package/dist/component/convex.config.js +4 -0
- package/dist/component/convex.config.js.map +1 -0
- package/dist/component/cronActions.d.ts +3 -0
- package/dist/component/cronActions.d.ts.map +1 -0
- package/dist/component/cronActions.js +38 -0
- package/dist/component/cronActions.js.map +1 -0
- package/dist/component/cronQueries.d.ts +6 -0
- package/dist/component/cronQueries.d.ts.map +1 -0
- package/dist/component/cronQueries.js +38 -0
- package/dist/component/cronQueries.js.map +1 -0
- package/dist/component/crons.d.ts +3 -0
- package/dist/component/crons.d.ts.map +1 -0
- package/dist/component/crons.js +18 -0
- package/dist/component/crons.js.map +1 -0
- package/dist/component/format.d.ts +11 -0
- package/dist/component/format.d.ts.map +1 -0
- package/dist/component/format.js +175 -0
- package/dist/component/format.js.map +1 -0
- package/dist/component/format.test.d.ts +2 -0
- package/dist/component/format.test.d.ts.map +1 -0
- package/dist/component/format.test.js +118 -0
- package/dist/component/format.test.js.map +1 -0
- package/dist/component/mutations.d.ts +158 -0
- package/dist/component/mutations.d.ts.map +1 -0
- package/dist/component/mutations.js +745 -0
- package/dist/component/mutations.js.map +1 -0
- package/dist/component/queries.d.ts +94 -0
- package/dist/component/queries.d.ts.map +1 -0
- package/dist/component/queries.js +574 -0
- package/dist/component/queries.js.map +1 -0
- package/dist/component/schema.d.ts +278 -0
- package/dist/component/schema.d.ts.map +1 -0
- package/dist/component/schema.js +161 -0
- package/dist/component/schema.js.map +1 -0
- package/dist/mcp/server.d.ts +11 -0
- package/dist/mcp/server.d.ts.map +1 -0
- package/dist/mcp/server.js +571 -0
- package/dist/mcp/server.js.map +1 -0
- package/dist/shared.d.ts +126 -0
- package/dist/shared.d.ts.map +1 -0
- package/dist/shared.js +67 -0
- package/dist/shared.js.map +1 -0
- package/dist/test.d.ts +23 -0
- package/dist/test.d.ts.map +1 -0
- package/dist/test.js +21 -0
- package/dist/test.js.map +1 -0
- package/eslint.config.js +15 -0
- package/example/convex/convex.config.ts +7 -0
- package/example/convex/memory.ts +129 -0
- package/llms.md +175 -0
- package/llms.txt +126 -0
- package/package.json +72 -0
- package/prds/API-REFERENCE.md +935 -0
- package/prds/README.md +988 -0
- package/prds/SETUP.md +682 -0
- package/src/cli/index.ts +254 -0
- package/src/cli/parsers/claude-code.ts +80 -0
- package/src/cli/parsers/codex.ts +45 -0
- package/src/cli/parsers/conductor.ts +47 -0
- package/src/cli/parsers/cursor.ts +55 -0
- package/src/cli/parsers/index.ts +30 -0
- package/src/cli/parsers/opencode.ts +84 -0
- package/src/cli/parsers/parsers.test.ts +201 -0
- package/src/cli/parsers/pi.ts +47 -0
- package/src/cli/parsers/types.ts +26 -0
- package/src/cli/parsers/vscode-copilot.ts +78 -0
- package/src/cli/parsers/zed.ts +47 -0
- package/src/cli/sync.ts +110 -0
- package/src/cli/type-extractor.test.ts +241 -0
- package/src/cli/type-extractor.ts +331 -0
- package/src/client/http.ts +415 -0
- package/src/client/index.ts +519 -0
- package/src/component/_generated/api.ts +14 -0
- package/src/component/_generated/dataModel.ts +20 -0
- package/src/component/_generated/server.ts +64 -0
- package/src/component/actions.ts +558 -0
- package/src/component/apiKeyMutations.ts +175 -0
- package/src/component/apiKeyQueries.ts +156 -0
- package/src/component/checksum.test.ts +31 -0
- package/src/component/checksum.ts +13 -0
- package/src/component/convex.config.ts +5 -0
- package/src/component/cronActions.ts +52 -0
- package/src/component/cronQueries.ts +42 -0
- package/src/component/crons.ts +34 -0
- package/src/component/format.test.ts +133 -0
- package/src/component/format.ts +232 -0
- package/src/component/mutations.ts +824 -0
- package/src/component/queries.ts +684 -0
- package/src/component/schema.ts +207 -0
- package/src/mcp/server.ts +695 -0
- package/src/shared.ts +251 -0
- package/src/test.ts +32 -0
- package/tsconfig.json +21 -0
- package/vitest.config.ts +8 -0
package/llms.txt
ADDED
|
@@ -0,0 +1,126 @@
|
|
|
1
|
+
# @waynesutton/agent-memory
|
|
2
|
+
|
|
3
|
+
> A Convex Component for persistent, cloud-synced agent memory. Markdown-first memory backend for AI coding agents across CLIs and IDEs.
|
|
4
|
+
|
|
5
|
+
## What It Does
|
|
6
|
+
|
|
7
|
+
AI coding agents (Claude Code, Cursor, OpenCode, Codex, Conductor, Zed, VS Code Copilot, Pi) use local file-based memory (CLAUDE.md, .cursor/rules, AGENTS.md). These are siloed to one machine with no shared backend, no cross-tool sync, and no queryable search.
|
|
8
|
+
|
|
9
|
+
agent-memory creates a cloud-synced, markdown-first memory backend as a Convex Component with full-text search, vector/semantic search, intelligent ingest, feedback loops, memory relations, relevance decay, a read-only HTTP API, and an MCP server with 14 tools.
|
|
10
|
+
|
|
11
|
+
## Installation
|
|
12
|
+
|
|
13
|
+
npm install @waynesutton/agent-memory
|
|
14
|
+
|
|
15
|
+
Peer dependencies: convex (>=1.17.0), convex-helpers (>=0.1.67)
|
|
16
|
+
|
|
17
|
+
## Quick Start
|
|
18
|
+
|
|
19
|
+
1. Register the component in convex/convex.config.ts:
|
|
20
|
+
|
|
21
|
+
import { defineApp } from "convex/server";
|
|
22
|
+
import agentMemory from "@waynesutton/agent-memory/convex.config.js";
|
|
23
|
+
const app = defineApp();
|
|
24
|
+
app.use(agentMemory);
|
|
25
|
+
export default app;
|
|
26
|
+
|
|
27
|
+
2. Create wrapper functions in convex/memory.ts:
|
|
28
|
+
|
|
29
|
+
import { AgentMemory } from "@waynesutton/agent-memory";
|
|
30
|
+
import { components } from "./_generated/api.js";
|
|
31
|
+
const memory = new AgentMemory(components.agentMemory, { projectId: "my-project" });
|
|
32
|
+
|
|
33
|
+
3. Deploy: npx convex dev
|
|
34
|
+
|
|
35
|
+
## Package Exports
|
|
36
|
+
|
|
37
|
+
- @waynesutton/agent-memory — AgentMemory class + types
|
|
38
|
+
- @waynesutton/agent-memory/http — MemoryHttpApi class for read-only HTTP API
|
|
39
|
+
- @waynesutton/agent-memory/convex.config.js — Convex component config
|
|
40
|
+
- @waynesutton/agent-memory/cli — CLI entry point
|
|
41
|
+
- @waynesutton/agent-memory/mcp — MCP server entry point
|
|
42
|
+
|
|
43
|
+
## AgentMemoryConfig
|
|
44
|
+
|
|
45
|
+
- projectId (string, required) — unique project identifier
|
|
46
|
+
- defaultScope ("project" | "user" | "org") — default "project"
|
|
47
|
+
- userId (string) — for user-scoped memories
|
|
48
|
+
- agentId (string) — agent identifier
|
|
49
|
+
- sessionId (string) — session/conversation ID
|
|
50
|
+
- embeddingApiKey (string) — enables vector search
|
|
51
|
+
- llmApiKey (string) — enables intelligent ingest
|
|
52
|
+
- llmModel (string) — default "gpt-4.1-nano"
|
|
53
|
+
|
|
54
|
+
## Key Methods
|
|
55
|
+
|
|
56
|
+
Read (query context):
|
|
57
|
+
- list(ctx, opts?) — list memories with filters (type, scope, agent, session, source, tags, date range)
|
|
58
|
+
- get(ctx, memoryId) — get single memory
|
|
59
|
+
- search(ctx, query, opts?) — full-text search
|
|
60
|
+
- getContextBundle(ctx, opts?) — 3-tier progressive context (pinned/relevant/available)
|
|
61
|
+
- exportForTool(ctx, format, opts?) — export as tool-native files
|
|
62
|
+
- history(ctx, memoryId) — change audit trail
|
|
63
|
+
- getFeedback(ctx, memoryId) — feedback entries
|
|
64
|
+
- getRelations(ctx, memoryId) — graph connections
|
|
65
|
+
|
|
66
|
+
Write (mutation context):
|
|
67
|
+
- remember(ctx, memory) — create memory (auto-records history)
|
|
68
|
+
- update(ctx, memoryId, updates) — partial update
|
|
69
|
+
- forget(ctx, memoryId) — archive (soft delete)
|
|
70
|
+
- restore(ctx, memoryId) — un-archive
|
|
71
|
+
- batchArchive(ctx, ids) — archive multiple
|
|
72
|
+
- addFeedback(ctx, memoryId, sentiment, opts?) — rate memory
|
|
73
|
+
- addRelation(ctx, from, to, relationship) — create graph edge
|
|
74
|
+
- recordAccess(ctx, ids) — track access for relevance decay
|
|
75
|
+
|
|
76
|
+
Action context:
|
|
77
|
+
- embed(ctx, memoryId) — generate vector embedding
|
|
78
|
+
- semanticSearch(ctx, query) — vector similarity search
|
|
79
|
+
- ingest(ctx, content, opts?) — intelligent fact extraction + dedup via LLM
|
|
80
|
+
|
|
81
|
+
API key management:
|
|
82
|
+
- createApiKey(ctx, opts) — create bearer token for HTTP API
|
|
83
|
+
- revokeApiKey(ctx, keyHash) — revoke a key
|
|
84
|
+
- listApiKeys(ctx) — list non-revoked keys
|
|
85
|
+
|
|
86
|
+
## Memory Types
|
|
87
|
+
|
|
88
|
+
- instruction — rules and conventions (maps to .claude/rules/, .cursor/rules/, AGENTS.md)
|
|
89
|
+
- learning — auto-discovered patterns
|
|
90
|
+
- reference — architecture docs, API specs
|
|
91
|
+
- feedback — corrections, preferences
|
|
92
|
+
- journal — session logs
|
|
93
|
+
|
|
94
|
+
## Schema (9 tables)
|
|
95
|
+
|
|
96
|
+
memories, embeddings, projects, syncLog, memoryHistory, memoryFeedback, memoryRelations, apiKeys, rateLimitTokens
|
|
97
|
+
|
|
98
|
+
## MCP Server (14 tools)
|
|
99
|
+
|
|
100
|
+
memory_remember, memory_recall, memory_semantic_recall, memory_list, memory_context, memory_forget, memory_restore, memory_update, memory_history, memory_feedback, memory_relate, memory_relations, memory_batch_archive, memory_ingest
|
|
101
|
+
|
|
102
|
+
## HTTP API Endpoints
|
|
103
|
+
|
|
104
|
+
All require Authorization: Bearer am_<key>
|
|
105
|
+
|
|
106
|
+
GET /list, /get?id=, /search?q=, /context, /export?format=, /history?id=, /relations?id=
|
|
107
|
+
|
|
108
|
+
## CLI Commands
|
|
109
|
+
|
|
110
|
+
agent-memory init, push, pull, list, search, mcp
|
|
111
|
+
|
|
112
|
+
## Supported Tool Formats
|
|
113
|
+
|
|
114
|
+
claude-code, cursor, opencode, codex, conductor, zed, vscode-copilot, pi, raw
|
|
115
|
+
|
|
116
|
+
## Cron Jobs
|
|
117
|
+
|
|
118
|
+
- relevance-decay — daily 3 AM UTC, reduces priority of stale memories
|
|
119
|
+
- cleanup-old-history — weekly Sunday 4 AM UTC, removes entries >90 days
|
|
120
|
+
- cleanup-rate-limit-tokens — hourly, removes expired rate limit windows
|
|
121
|
+
|
|
122
|
+
## Documentation
|
|
123
|
+
|
|
124
|
+
- Full API reference: prds/API-REFERENCE.md
|
|
125
|
+
- Setup guide: prds/SETUP.md
|
|
126
|
+
- README: prds/README.md
|
package/package.json
ADDED
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@waynesutton/agent-memory",
|
|
3
|
+
"version": "0.0.1",
|
|
4
|
+
"description": "A Convex Component for persistent, cloud-synced agent memory. Markdown-first memory backend for AI coding agents across CLIs and IDEs.",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"main": "./dist/client/index.js",
|
|
7
|
+
"types": "./dist/client/index.d.ts",
|
|
8
|
+
"exports": {
|
|
9
|
+
".": {
|
|
10
|
+
"types": "./dist/client/index.d.ts",
|
|
11
|
+
"default": "./dist/client/index.js"
|
|
12
|
+
},
|
|
13
|
+
"./convex.config.js": "./dist/component/convex.config.js",
|
|
14
|
+
"./_generated/component.js": "./dist/component/_generated/component.js",
|
|
15
|
+
"./test": "./src/test.ts",
|
|
16
|
+
"./cli": "./dist/cli/index.js",
|
|
17
|
+
"./mcp": "./dist/mcp/server.js",
|
|
18
|
+
"./http": {
|
|
19
|
+
"types": "./dist/client/http.d.ts",
|
|
20
|
+
"default": "./dist/client/http.js"
|
|
21
|
+
}
|
|
22
|
+
},
|
|
23
|
+
"bin": {
|
|
24
|
+
"agent-memory": "./dist/cli/index.js"
|
|
25
|
+
},
|
|
26
|
+
"scripts": {
|
|
27
|
+
"build": "tsc",
|
|
28
|
+
"dev": "tsc --watch",
|
|
29
|
+
"lint": "eslint src/",
|
|
30
|
+
"test": "vitest run",
|
|
31
|
+
"test:watch": "vitest",
|
|
32
|
+
"codegen": "convex codegen --component-dir ./src/component"
|
|
33
|
+
},
|
|
34
|
+
"keywords": [
|
|
35
|
+
"convex",
|
|
36
|
+
"component",
|
|
37
|
+
"agent",
|
|
38
|
+
"memory",
|
|
39
|
+
"ai",
|
|
40
|
+
"markdown",
|
|
41
|
+
"mcp",
|
|
42
|
+
"claude-code",
|
|
43
|
+
"cursor",
|
|
44
|
+
"opencode",
|
|
45
|
+
"codex"
|
|
46
|
+
],
|
|
47
|
+
"license": "Apache-2.0",
|
|
48
|
+
"publishConfig": {
|
|
49
|
+
"access": "public"
|
|
50
|
+
},
|
|
51
|
+
"peerDependencies": {
|
|
52
|
+
"convex": ">=1.17.0",
|
|
53
|
+
"convex-helpers": ">=0.1.67"
|
|
54
|
+
},
|
|
55
|
+
"devDependencies": {
|
|
56
|
+
"convex": "^1.17.0",
|
|
57
|
+
"convex-helpers": "^0.1.67",
|
|
58
|
+
"convex-test": "^0.0.34",
|
|
59
|
+
"typescript": "^5.5.0",
|
|
60
|
+
"vitest": "^3.0.0"
|
|
61
|
+
},
|
|
62
|
+
"dependencies": {
|
|
63
|
+
"@modelcontextprotocol/sdk": "^1.0.0",
|
|
64
|
+
"chokidar": "^4.0.0",
|
|
65
|
+
"commander": "^13.0.0",
|
|
66
|
+
"fast-glob": "^3.3.3",
|
|
67
|
+
"gray-matter": "^4.0.3"
|
|
68
|
+
},
|
|
69
|
+
"optionalDependencies": {
|
|
70
|
+
"types-not-docs": "^1.0.0"
|
|
71
|
+
}
|
|
72
|
+
}
|