Skip to main content

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

  1. Daily scan — runs against your git repos and memory files, extracts failure/success/plan traces via Claude, and saves them with an impact score
  2. SQLite DB — stores all traces and distilled principles locally at ~/.forgemem/forgemem_memory.db
  3. 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 Apache-2.0 for community use. Hosted service offerings (if any) are covered by separate commercial terms.

  • Community: Apache-2.0 (permissive, local-first, commercial-friendly)
  • Enterprise: hosted terms with optional SLA, SSO/SAML, audit logs, priority support, and private hosting options
  • 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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

forgemem-0.1.1.tar.gz (51.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

forgemem-0.1.1-py3-none-any.whl (59.3 kB view details)

Uploaded Python 3

File details

Details for the file forgemem-0.1.1.tar.gz.

File metadata

  • Download URL: forgemem-0.1.1.tar.gz
  • Upload date:
  • Size: 51.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.12

File hashes

Hashes for forgemem-0.1.1.tar.gz
Algorithm Hash digest
SHA256 ef5d201681026d10310c127ceae8a037c7b7be065dcd2350fd2a967a8f150294
MD5 a63dabce75b2bd396f426c3441ae7484
BLAKE2b-256 69593f0bfd19e599a6abafb502577eb7d44d525ca059e0347a78afab539367a6

See more details on using hashes here.

File details

Details for the file forgemem-0.1.1-py3-none-any.whl.

File metadata

  • Download URL: forgemem-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 59.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.12

File hashes

Hashes for forgemem-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 7481ae9640312545a1d23c7d074fad03c56093661682d64983f90c8987a2b7c8
MD5 a2dca63a61c65893a992dee8ebbcb251
BLAKE2b-256 7570d598435161e5c1e3b2d5dfbab312aa9819f90b24988113e391853a58548b

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page