@jcyamacho/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/README.md +210 -0
- package/dist/index.js +20317 -0
- package/package.json +41 -0
package/README.md
ADDED
|
@@ -0,0 +1,210 @@
|
|
|
1
|
+
# agent-memory
|
|
2
|
+
|
|
3
|
+
Persistent memory for MCP-powered coding agents.
|
|
4
|
+
|
|
5
|
+
`agent-memory` gives your LLM a durable memory layer backed by SQLite. It is a
|
|
6
|
+
small MCP server with two focused tools:
|
|
7
|
+
|
|
8
|
+
- `remember` -> save facts, decisions, preferences, and project context
|
|
9
|
+
- `recall` -> retrieve the most relevant memories later
|
|
10
|
+
|
|
11
|
+
It is designed for agent workflows where context should survive across turns,
|
|
12
|
+
sessions, and even different clients.
|
|
13
|
+
|
|
14
|
+
## Why Use It
|
|
15
|
+
|
|
16
|
+
Most agents lose useful context between runs. This server lets them keep things
|
|
17
|
+
that actually matter:
|
|
18
|
+
|
|
19
|
+
- User preferences like tone, formatting, and workflow habits
|
|
20
|
+
- Project facts like architecture choices, paths, and constraints
|
|
21
|
+
- Ongoing decisions like naming, scope, and tradeoffs
|
|
22
|
+
- Session-specific notes that should still be discoverable later
|
|
23
|
+
|
|
24
|
+
The result is an agent that feels less stateless and less repetitive.
|
|
25
|
+
|
|
26
|
+
## Features
|
|
27
|
+
|
|
28
|
+
- SQLite-backed persistence with automatic database creation
|
|
29
|
+
- Full-text recall with ranking, filters, and date bounds
|
|
30
|
+
- Compact write acknowledgments to avoid wasting tokens
|
|
31
|
+
- Durable memory scoped by `source`, `workspace`, and `session`
|
|
32
|
+
- MCP-native tool descriptions optimized for LLM use
|
|
33
|
+
|
|
34
|
+
## Tools
|
|
35
|
+
|
|
36
|
+
### `remember`
|
|
37
|
+
|
|
38
|
+
Save durable context for later recall.
|
|
39
|
+
|
|
40
|
+
Inputs:
|
|
41
|
+
|
|
42
|
+
- `content` -> the fact, preference, decision, or context to remember
|
|
43
|
+
- `source` -> where the memory came from, such as a client, tool, or agent
|
|
44
|
+
- `workspace` -> repository or workspace path for project scoping
|
|
45
|
+
- `session` -> conversation or execution session identifier
|
|
46
|
+
|
|
47
|
+
Output:
|
|
48
|
+
|
|
49
|
+
- `id`
|
|
50
|
+
- `source`
|
|
51
|
+
- `workspace`
|
|
52
|
+
- `session`
|
|
53
|
+
- `created_at`
|
|
54
|
+
|
|
55
|
+
### `recall`
|
|
56
|
+
|
|
57
|
+
Retrieve relevant memories for the current task.
|
|
58
|
+
|
|
59
|
+
Inputs:
|
|
60
|
+
|
|
61
|
+
- `query` -> keywords, facts, names, or phrases to search for
|
|
62
|
+
- `limit` -> max results to return
|
|
63
|
+
- `preferred_source` -> rank memories from this source higher
|
|
64
|
+
- `preferred_workspace` -> rank memories from this workspace higher
|
|
65
|
+
- `filter_source` -> only return memories from this exact source
|
|
66
|
+
- `filter_workspace` -> only return memories from this exact workspace
|
|
67
|
+
- `created_after` -> ISO 8601 lower bound
|
|
68
|
+
- `created_before` -> ISO 8601 upper bound
|
|
69
|
+
|
|
70
|
+
Output:
|
|
71
|
+
|
|
72
|
+
- `results[]` with `id`, `content`, `score`, `source`, `workspace`, `session`,
|
|
73
|
+
and `created_at`
|
|
74
|
+
|
|
75
|
+
## Installation
|
|
76
|
+
|
|
77
|
+
### From npm
|
|
78
|
+
|
|
79
|
+
```bash
|
|
80
|
+
npm install -g @jcyamacho/agent-memory
|
|
81
|
+
```
|
|
82
|
+
|
|
83
|
+
### From source
|
|
84
|
+
|
|
85
|
+
```bash
|
|
86
|
+
bun install
|
|
87
|
+
bun run build
|
|
88
|
+
```
|
|
89
|
+
|
|
90
|
+
The CLI entrypoint is:
|
|
91
|
+
|
|
92
|
+
```bash
|
|
93
|
+
agent-memory
|
|
94
|
+
```
|
|
95
|
+
|
|
96
|
+
## Requirements
|
|
97
|
+
|
|
98
|
+
- Node.js
|
|
99
|
+
- A normal package install with `node_modules`
|
|
100
|
+
|
|
101
|
+
Important: the build keeps `better-sqlite3` external on purpose. That is
|
|
102
|
+
required for its native binding to load correctly at runtime.
|
|
103
|
+
|
|
104
|
+
## Configuration
|
|
105
|
+
|
|
106
|
+
By default, the SQLite database is created at:
|
|
107
|
+
|
|
108
|
+
```text
|
|
109
|
+
~/.config/agent-memory/memory.db
|
|
110
|
+
```
|
|
111
|
+
|
|
112
|
+
Override it with:
|
|
113
|
+
|
|
114
|
+
```bash
|
|
115
|
+
AGENT_MEMORY_DB_PATH=/absolute/path/to/memory.db
|
|
116
|
+
```
|
|
117
|
+
|
|
118
|
+
Example:
|
|
119
|
+
|
|
120
|
+
```bash
|
|
121
|
+
AGENT_MEMORY_DB_PATH="$HOME/.local/share/agent-memory/memory.db" agent-memory
|
|
122
|
+
```
|
|
123
|
+
|
|
124
|
+
## Running It
|
|
125
|
+
|
|
126
|
+
### Development
|
|
127
|
+
|
|
128
|
+
```bash
|
|
129
|
+
bun install
|
|
130
|
+
bun run build
|
|
131
|
+
node dist/index.js
|
|
132
|
+
```
|
|
133
|
+
|
|
134
|
+
### Local validation
|
|
135
|
+
|
|
136
|
+
```bash
|
|
137
|
+
bun lint
|
|
138
|
+
bun test
|
|
139
|
+
bun run build
|
|
140
|
+
```
|
|
141
|
+
|
|
142
|
+
## MCP Client Configuration
|
|
143
|
+
|
|
144
|
+
Example MCP server entry:
|
|
145
|
+
|
|
146
|
+
```json
|
|
147
|
+
{
|
|
148
|
+
"mcpServers": {
|
|
149
|
+
"memory": {
|
|
150
|
+
"command": "agent-memory",
|
|
151
|
+
"env": {
|
|
152
|
+
"AGENT_MEMORY_DB_PATH": "/absolute/path/to/memory.db"
|
|
153
|
+
}
|
|
154
|
+
}
|
|
155
|
+
}
|
|
156
|
+
}
|
|
157
|
+
```
|
|
158
|
+
|
|
159
|
+
If you are running from source instead of a global install, use:
|
|
160
|
+
|
|
161
|
+
```json
|
|
162
|
+
{
|
|
163
|
+
"mcpServers": {
|
|
164
|
+
"memory": {
|
|
165
|
+
"command": "node",
|
|
166
|
+
"args": [
|
|
167
|
+
"/absolute/path/to/agent-memory/dist/index.js"
|
|
168
|
+
],
|
|
169
|
+
"env": {
|
|
170
|
+
"AGENT_MEMORY_DB_PATH": "/absolute/path/to/memory.db"
|
|
171
|
+
}
|
|
172
|
+
}
|
|
173
|
+
}
|
|
174
|
+
}
|
|
175
|
+
```
|
|
176
|
+
|
|
177
|
+
## Recommended LLM Instructions
|
|
178
|
+
|
|
179
|
+
Copy and paste this into your system prompt, `AGENTS.md`, `CLAUDE.md`, or
|
|
180
|
+
similar instruction file.
|
|
181
|
+
|
|
182
|
+
```text
|
|
183
|
+
Use `memory_recall` at the start of a task, when the user refers to previous
|
|
184
|
+
context, or whenever prior preferences, project facts, or decisions may help.
|
|
185
|
+
|
|
186
|
+
Use `memory_remember` to save durable context that will matter later, such as
|
|
187
|
+
user preferences, project conventions, architecture decisions, constraints, and
|
|
188
|
+
stable workflow habits.
|
|
189
|
+
|
|
190
|
+
Store concise, self-contained facts or short notes. Include `source`,
|
|
191
|
+
`workspace`, and `session` when available so future retrieval is better scoped.
|
|
192
|
+
|
|
193
|
+
Do not store secrets, credentials, API keys, tokens, or temporary noise.
|
|
194
|
+
|
|
195
|
+
When recalling, use short factual queries and keep `limit` small unless you
|
|
196
|
+
need broader recall. Use `preferred_workspace` or `preferred_source` to bias
|
|
197
|
+
ranking, and `filter_workspace` or `filter_source` only when exact scoping is
|
|
198
|
+
required.
|
|
199
|
+
```
|
|
200
|
+
|
|
201
|
+
## Development Notes
|
|
202
|
+
|
|
203
|
+
- Runtime target is Node-compatible output at `dist/index.js`
|
|
204
|
+
- Local workflows use Bun
|
|
205
|
+
- Tests use `bun:test`
|
|
206
|
+
- Runtime code avoids Bun-only APIs
|
|
207
|
+
|
|
208
|
+
## License
|
|
209
|
+
|
|
210
|
+
MIT
|