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