Persistent memory for AI agents — cross-session context that actually sticks
Project description
Forgemem
Long-term memory and knowledge base built from your real activity as a developer.
Forgemem mines your git history, session traces, and project notes to extract what actually happened — failures, successes, plans, and hard-won lessons. It stores them in a local SQLite database so that any agent you work with can learn from your past before wasting tokens walking down paths you've already hit dead ends on.
The Problem It Solves
Every new agent session starts blind. It doesn't know that you already tried the Zod 4 schema approach and it broke. It doesn't know that wildcard CORS killed auth in production. It doesn't know that the cleanup phase always needs to come after the dev phase, not during.
Without Forgemem, agents repeat your mistakes. With it, they skip to what works.
How It Works
- Daily scan — runs against your git repos and memory files, extracts failure/success/plan traces via Claude, and saves them with an impact score
- SQLite DB — stores all traces and distilled principles locally at
~/.forgemem/forgemem_memory.db - MCP server — exposes the DB to agents via the Model Context Protocol so they can query it before starting any task
MCP Access
Claude Code (stdio — already configured)
Any Claude Code session on this machine has Forgemem registered globally in ~/.claude/settings.json. No setup needed — just call retrieve_memories before starting work.
Other agents (Gemini CLI, OpenCode, Copilot) — HTTP/SSE
Start the HTTP server:
cd ~/Developer/Forgemem
.venv/bin/python3 mcp_server.py --http
# → http://127.0.0.1:7474/sse
Then point your agent's MCP config at http://127.0.0.1:7474/sse.
Tools Exposed
| Tool | Purpose |
|---|---|
retrieve_memories |
Search principles and traces by keyword before starting a task |
save_trace |
Save a failure, success, plan, or note during/after a session |
forgemem_stats |
Summary of DB contents + agent connection history |
Key Commands
# Run the daily knowledge mining scan
.venv/bin/python3 daily_scan.py
# Query from CLI
.venv/bin/python3 forgemem.py retrieve "auth debugging"
# Check DB stats + who connected
.venv/bin/python3 forgemem.py stats
The Goal
Agents should always call retrieve_memories at the start of any task. That one call surfaces the top failures and principles from your history that match what they're about to do — so they don't burn tokens re-learning what you already know.
Licensing & Commercial Use
Forgemem is AGPL-3.0 for community use. If you want to run it as part of a hosted service, embed it in commercial products, or avoid AGPL obligations, we offer a commercial/enterprise license and support.
- Community: AGPL-3.0 (local-first, source-available, copyleft)
- Enterprise: commercial license with optional SLA, SSO/SAML, audit logs, priority support, and private hosting options — see COMMERCIAL.md
- Donations: GitHub Sponsors (coming soon)
Contributing: All contributors must sign the CLA by adding their name to CONTRIBUTORS.md in their first PR.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file forgemem-0.1.0.tar.gz.
File metadata
- Download URL: forgemem-0.1.0.tar.gz
- Upload date:
- Size: 59.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
0c8beeec4fdec11de68cfbe8b065cd5c81e08499a1d90bed3ff6dc9397bf9953
|
|
| MD5 |
239a23d4b23ac320f7ae6e7802df8c71
|
|
| BLAKE2b-256 |
4ad0f170d3fbb19442174b56bcb5812b7e2d59611b0e3949d718a1f7bf010758
|
File details
Details for the file forgemem-0.1.0-py3-none-any.whl.
File metadata
- Download URL: forgemem-0.1.0-py3-none-any.whl
- Upload date:
- Size: 67.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
11e73518d27403ca03092f729d69f0c470c60c1dfea478230803b4d079e57590
|
|
| MD5 |
8f1786a088f6236341186c1a847511db
|
|
| BLAKE2b-256 |
25944813d34e97eb7dcb14713132e3c1b70dd9119d519d29c4caf3164a283355
|