Fragmenta is a lightweight, MCP-native memory engine for AI systems.
It stores, scores, and retrieves contextual fragments (facts, preferences, interactions) across sessions—giving LLMs persistent, structured memory without black-box complexity.
LLMs forget everything between requests.
Fragmenta adds:
- persistent memory
- deterministic ranking
- transparent storage
- local-first control
-
🧩 Fragment-Based Memory
- Store atomic knowledge units
-
⚖️ Deterministic Ranking
-
Based on:
- recency
- frequency
- importance
- decay
-
-
🔍 Context Retrieval
- Query top relevant fragments instantly
-
🔌 MCP-Native
- Works with Claude, Cursor, custom agents
-
💾 Pluggable Storage
- JSONL (default)
- SQLite
-
🔎 Inspectable
- No hidden embeddings required
User Input → Fragment Extractor → Memory Store ↔ Scoring Engine → Retrieval Engine → LLM Context Injection
git clone https://github.com/makalin/fragmenta.git
cd fragmenta
npm installnpm run devPOST /memory
{
"content": "User prefers minimal UI",
"tags": ["preference", "ui"],
"importance": 0.9
}POST /query
{
"query": "UI preference",
"limit": 5
}GET /memory?tag=ui&search=minimal&limit=10GET /memory/stats{
"id": "uuid",
"content": "User prefers minimal UI",
"tags": ["preference"],
"created_at": 1710000000,
"last_accessed": 1710001000,
"access_count": 3,
"importance": 0.9
}score =
(importance * 0.4) +
(recency * 0.3) +
(frequency * 0.2) -
(decay * 0.1)
Fully deterministic and tunable.
{
"mcpServers": {
"fragmenta": {
"command": "node",
"args": ["dist/server.js"]
}
}
}POST /memory- store a fragmentPOST /query- retrieve ranked fragmentsGET /memory- list fragments with filtersGET /memory/:id- fetch one fragmentDELETE /memory/:id- delete one fragmentGET /memory/stats- aggregate memory statisticsGET /health- health check
store_memoryquery_memorylist_memoriesget_memorydelete_memorymemory_stats
fragmenta/
├── src/
│ ├── server/
│ │ ├── mcp.ts
│ │ ├── api.ts
│ │ └── routes/
│ │
│ ├── memory/
│ │ ├── fragment.ts
│ │ ├── store.ts
│ │ └── schema.ts
│ │
│ ├── scoring/
│ │ ├── score.ts
│ │ ├── decay.ts
│ │ └── rank.ts
│ │
│ ├── retrieval/
│ │ ├── query.ts
│ │ └── filter.ts
│ │
│ ├── storage/
│ │ ├── jsonl.ts
│ │ ├── sqlite.ts
│ │ └── adapter.ts
│ │
│ ├── utils/
│ │ ├── time.ts
│ │ └── logger.ts
│ │
│ └── index.ts
│
├── data/
│ └── memory.jsonl
│
├── config/
│ └── default.json
│
├── tests/
│
├── package.json
├── tsconfig.json
└── README.md
- Velo-Lite backend as the scalable production backend
- Velo-Lite backend with multi-agent shared memory
- Velo-Lite namespaces for agent, team, and tenant isolation
- Velo-Lite shared channels for cross-agent context exchange
- Velo-Lite write conflict resolution and optimistic concurrency
- Velo-Lite replication, backup, and recovery workflows
-
update_memorytool andPATCH /memory/:id -
bulk_store_memoriesfor batched ingestion -
bulk_delete_memoriesfor cleanup jobs -
search_by_tagsshortcut tool -
export_memoriesto JSON/JSONL -
import_memoriesfrom JSON/JSONL -
pin_memoryor protected fragments -
archive_memoryand soft-delete support -
memory_timelinefor chronological inspection -
memory_explainto show score breakdown per fragment
- Semantic search (optional embeddings)
- Hybrid lexical + semantic ranking
- Better exact-match and phrase-match scoring
- Per-tag weighting and query boosting
- Configurable decay strategies
- Deduplication and fragment merging
- Default SQLite mode for safer concurrent writes
- Storage migrations and schema versioning
- Snapshot and backup support
- File locking for JSONL mode
- Background compaction and repair tools
- API auth token support
- Rate limiting
- Request audit logging
- CORS and host allowlist controls
- Configurable request size limits
- Safer production defaults
- CLI tool
- Visualization UI
- OpenAPI spec for the HTTP API
- More integration and concurrency tests
- Docker image and compose setup
- Benchmark suite
- Multi-agent shared memory
- Agent namespaces and tenant isolation
- Shared memory rooms or channels
- Agent attribution on fragments
- Conflict resolution for concurrent writes
- Cross-agent memory permissions
- Local-first
- Transparent > magical
- Deterministic > probabilistic
- Simple > complex
MIT