@shahmilsaari/memory-core
v1.0.53
Published
Universal AI memory core — generate AI context files from architecture profiles with RAG support
Maintainers
Readme
memory-core
Universal AI memory for developers. Store architecture rules once — every AI coding agent reads them before writing code.
The problem
AI tools like Copilot, Cursor, and Claude Code start fresh every session. They don't know your architecture decisions, your layer boundaries, or your team conventions. They write code that violates patterns you spent months establishing.
memory-core fixes that. Store your rules once, enforce them everywhere.
What it does
- Remember — store architecture decisions and rules in PostgreSQL with plain-English reasons
- Distribute — generate instruction files for 14 AI agents automatically from your stored rules
- Enforce — multi-tier pipeline: deterministic layer graph (instant, confidence 1.0) → AI semantic review → optional model critique second opinion → confidence gate arbitrates. Auto-fixes violations on save by default.
npx @shahmilsaari/memory-core initKey features
- 281 pre-built rules — seed best-practice rules for your stack in one command, with plain-English reasons
- 14 AI agents supported — generates instruction files for Copilot, Cursor, Claude Code, Windsurf, and more automatically
- Evidence-based enforcement — deterministic AST + dependency graph catches layer violations instantly; AI semantic review with confidence gating catches the rest; optional AI auto-fix on save
- Runs fully local — embeddings stay on your machine via Ollama; use any cloud provider (DeepSeek, OpenAI, Anthropic) only for code analysis
- Live dashboard — real-time violations feed, interactive architecture graph, memory model-check with batch resolve, and model switcher at
localhost:5178 - Team-ready — export rules to
memories.json, commit it, and teammates import with one command — no shared database needed - Token-optimized — compressed prompts, prompt caching, and confidence-gated model critique save ~58% tokens per check without sacrificing accuracy
- CI/CD built-in — generates a GitHub Actions workflow; CI reads
memories.jsondirectly, no Ollama required - Commit message linting — enforce conventional commits or any regex pattern via the
commit-msghook - Violation analytics — track which rules fire most and auto-tune noisy ones with
memory-core tune - Pre-commit hook — advisory or strict mode; bypass anytime with
MEMORY_CORE_SKIP_HOOK=1
Get started
Requires: Node.js ≥ 18, PostgreSQL 14+, Ollama with nomic-embed-text
# 1. Initialize in your project
npx @shahmilsaari/memory-core init
# 2. Load best-practice rules for your stack
memory-core seed --arch clean-architecture
# 3. Store your own decisions
memory-core remember "No direct DB calls from controllers"
# 4. Enforce on every commit
memory-core hook installThat's it. Every AI agent in your project now reads your rules before writing code.
Supported agents
Claude Code · GitHub Copilot · Cursor · Windsurf · Cline · Roo Code · Aider · Continue.dev · Devin · Amazon Q · Gemini Code Assist · Zed AI · JetBrains AI · OpenHands
Architecture profiles
281 pre-built rules ready to load:
clean-architecture · nestjs · react · svelte · vue · hexagonal · modular-monolith · mvc · laravel-service-repository · nuxt · angular · go-api · react-native
Commands
memory-core remember "..." # store a rule or decision
memory-core sync # push rules to all AI agent files
memory-core check --diff HEAD~1 # enforce architecture on a diff (deterministic by default)
memory-core check --diff HEAD~1 --ai # same, but with AI analysis
memory-core watch # real-time violation detection on save
memory-core watch --auto-fix # also auto-rewrite violating files via AI
memory-core dashboard # live command center at localhost:5178
memory-core export # share rules with your team via memories.json
memory-core stats # see which rules fire mostEnvironment
Local Ollama (default):
DATABASE_URL=postgresql://localhost:5432/memory_core
EMBEDDING_URL=http://localhost:11434
EMBEDDING_MODEL=nomic-embed-text
EMBEDDING_TIMEOUT_MS=30000
CHAT_PROVIDER=ollama
CHAT_MODEL=qwen2.5-coder:7b
CHAT_URL=http://localhost:11434
CHAT_TIMEOUT_MS=120000Remote Ollama (different host for embedding and chat):
DATABASE_URL=postgresql://localhost:5432/memory_core
EMBEDDING_URL=http://192.168.1.10:11434
EMBEDDING_MODEL=nomic-embed-text
EMBEDDING_TIMEOUT_MS=30000
CHAT_PROVIDER=ollama
CHAT_MODEL=qwen2.5-coder:7b
CHAT_URL=http://192.168.1.10:11434
CHAT_TIMEOUT_MS=120000Cloud provider for chat, local Ollama for embedding:
DATABASE_URL=postgresql://localhost:5432/memory_core
EMBEDDING_URL=http://localhost:11434
EMBEDDING_MODEL=nomic-embed-text
CHAT_PROVIDER=openai
CHAT_MODEL=gpt-4o-mini
CHAT_API_KEY=sk-...
EMBEDDING_URLandCHAT_URLare independent — point them to different hosts if needed.EMBEDDING_TIMEOUT_MSdefaults to 5 s; increase to 30 s+ for remote Ollama.
Links
License
MIT
