Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
43 changes: 43 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
name: CI

on:
push:
branches: [main]
pull_request:

jobs:
test:
name: Tests (Node ${{ matrix.node }})
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
node: ["22.16", "22.x", "24.x"]
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node }}
cache: npm
- run: npm ci
- run: npm run lint
# Uses the deterministic hash embedder: no model download.
- run: npm test

retrieval-quality:
name: Retrieval quality (real model)
runs-on: ubuntu-latest
needs: test
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 24.x
cache: npm
- run: npm ci
- uses: actions/cache@v4
with:
path: ~/.cache/agent-memory-store
key: hf-${{ hashFiles('src/embeddings.js', 'package-lock.json') }}
- run: AMS_MODEL_TESTS=1 node --no-warnings --test test/e2e-model.test.js
- run: npm run bench
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
node_modules
.agent-memory-store
.claude
benchmarks/.cache
benchmarks/.cache
.DS_Store
61 changes: 61 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
# Contributing

## Setup

```bash
git clone https://github.com/vbfs/agent-memory-store
cd agent-memory-store
npm install
npm test # unit + end-to-end (stdio) + multi-process tests, no model download
AMS_MODEL_TESTS=1 npm test # also end-to-end with the real embedding model
```

Requires Node.js >= 22.16 (built-in `node:sqlite`).

## Layout

```
src/
index.js MCP server: tool schemas, formatting, errors
embeddings.js Embedder interface, local models, HashEmbedder (tests)
migrate.js One-time import of the legacy markdown file store
store/
memory-store.js MemoryStore: schema + migrations, write/search/list/state
fts-query.js Safe FTS5 query builder (never a syntax error)
vector-index.js In-memory exact vector index
secrets.js Credential detection on write
test/ node:test suites (run with `npm test`)
benchmarks/ bench (quality + speed), golden set, LongMemEval — all use MemoryStore
```

There is one implementation of storage and ranking (`MemoryStore`). The MCP
server, the tests and every benchmark use it — never copy search logic into a
benchmark.

## Changing ranking or the embedding model

Run before and after, and include both outputs in the PR:

```bash
npm run bench # quality + speed, ~30 s
npm run bench:tune-fusion # if you touched fusion or ranking
```

Report the metrics exactly as printed. Do not compare against numbers from
other systems unless they use the same dataset, granularity and metric.

## Schema changes

Bump `SCHEMA_VERSION` in `src/store/memory-store.js`, add a migration step
that runs inside the existing transaction, and add a test that opens a
database created with the previous schema.

## Commits

[Conventional Commits](https://www.conventionalcommits.org/): `feat:`, `fix:`,
`docs:`, `test:`, `perf:`, `refactor:`.

## Reporting issues

Include the Node.js version, OS, `AGENT_MEMORY_MODEL` (if set), the tool call
and arguments, and the server's stderr output.
65 changes: 0 additions & 65 deletions Contributing.md

This file was deleted.

21 changes: 21 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
MIT License

Copyright (c) 2026 Vinícius Barreto

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
Loading
Loading