firm-memory-mcp
Click on "Install Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@firm-memory-mcpsearch firm memory for why OMS rejects orders after 15:20"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
firm-memory
A memory layer that lets our AI coding agents remember how this firm builds software, so they stop relearning the same things on every call.
CodeGraph answers "what is the code doing?" Firm Memory answers "why do we build it this way?"
CodeGraph stays authoritative for current code behaviour. Memory holds contextual engineering knowledge — and may go stale, which is why when memory and the current code disagree, the code wins.
The shape of it
OpenCode On-call Future agent
└───────────────┼───────────────┘
│ MCP
┌────────▼─────────┐
│ Firm Memory MCP │ thin transport adapter
└────────┬─────────┘
│
┌────────▼─────────┐
│ Firm Memory │ taxonomy · scope · provenance · lifecycle
└────────┬─────────┘
│ MemoryProvider
┌────────▼─────────┐
│ mem0 │ embeddings · vector search · ranking
└──────────────────┘The platform owns what a firm memory means. The provider owns how it is stored and retrieved. MCP owns how agents access it. That separation is the whole point: a second provider can be introduced without changing OpenCode or the MCP contract.
Related MCP server: AgentBase
Quick start
pip install -e '.[mem0,pgvector,rerank,mcp,dev]'
export FIRM_MEM0_PG_DSN='postgresql://mem0:pw@db.internal:5432/mem0'
export FIRM_MEMORY_DOMAINS='execution,mcx' # this repo's domains
export FIRM_MEMORY_CANDIDATES_PATH='.firm-memory/candidates.json'from firm_memory import FirmMemory, MemoryScope, MemoryType
memory = FirmMemory.from_env() # scoped to this checkout + its domains + the firm
for hit in memory.search("why does OMS reject orders after 15:20"):
print(hit.id, hit.content, hit.provenance.reference)
proposal = memory.propose(
"Cash strategies stop sending at 15:20 because the exchange rejects after that.",
type=MemoryType.BUSINESS_RULE,
scope=MemoryScope(domains=("execution",), repos=("oms", "gateway")),
reference="mr-4821",
)
# Not stored as knowledge yet — it is queued for a human:
print(proposal.accepted, proposal.candidate_id, proposal.decision.reason)
memory.approvals.approve(proposal.candidate_id, approver="ashish")Run the MCP server for agents:
firm-memory-mcp # stdio; exposes memory_search / memory_get / memory_propose / memory_correctThe five things this package owns
1. Taxonomy
A provider's stock extraction is tuned for consumer assistants (food, hobbies, music). Ours is tuned for trading systems. Thirteen types, each with the description that drives extraction:
ARCHITECTURE_DECISION · REJECTED_APPROACH · CONVENTION · REVIEW_PATTERN ·
BUG_FIX · TASK_LEARNING · TOOLING_SETUP · DEPENDENCY_DECISION ·
PERFORMANCE_FINDING · BUSINESS_RULE · PRODUCTION_ISSUE · OWNERSHIP ·
TERMINOLOGY
Enforced before anything reaches a provider. Both spellings resolve — the member
name (BUSINESS_RULE) and the stable wire slug (business_rules).
Just as important are the exclusions: no source code, diffs or stack traces; no secrets; no facts about individual engineers; no transient state.
2. Scope
Independent attributes, not a hierarchy — because firm knowledge does not respect a tree:
{"firm": true, "domains": ["execution"], "repos": ["oms", "gateway"]}A memory spanning three repos is stored once and reachable from each of them. There is deliberately no engineer-level and no team-level scope: the same question must return the same firm knowledge whoever asks, and an identity axis would split one fact into copies that drift apart.
3. Tiers
The lifetime axis, orthogonal to approval status:
Tier | What it holds | Task-scoped? |
| Per-MR working memory — findings and their dispositions | Yes, required |
| Distilled knowledge, written through the approval gate | Never |
| One verbatim card per closed issue/MR, kept document-shaped | Never |
Search excludes EPISODIC by default. That default is load bearing: to a vector
store an absent task filter means "don't care", not "unset", so without it
every MR's scratch state joins ordinary recall. It has a contract test.
4. Provenance and lifecycle
Every memory carries where it came from, so an engineer can trace a citation back to the MR, issue or interview behind it — and correct it.
Candidate ─► taxonomy / scope / provenance checks ─► human approval ─► provider.insert()V1 is fully human approved; confidence is recorded from the start so automation can be switched on later without a migration. Business rules, architecture decisions, firm conventions and production-critical knowledge always need a person, whatever the confidence.
Nothing deletes. A correction demotes and flags; supersession names the replacement. The record that a decision was made — and unmade — survives.
5. Reliability
Memory is best effort. Reads never raise: a provider outage or a breach of the bounded timeout yields an empty result and a recorded metric, so a failed recall cannot fail a code review. Writes do raise — silently dropping a memory an engineer just approved would be worse than an error.
Configuration
Platform settings are provider-independent; provider settings are read by the provider itself. That split is what keeps a provider swap a config change.
Variable | Default | Meaning |
|
| Which provider to use |
|
| Results per search |
|
| Relevance floor |
|
| Bounded wait before giving up |
| — | Domains this checkout belongs to |
| (git remote) | Override the repo slug |
| (in-process) | Where proposals wait for a human |
|
| Confidence-based automation |
| required | pgvector connection string |
|
| Collection name |
|
|
|
|
| Local cross-encoder reranking |
FIRM_MEM0_REPO, FIRM_MEM0_TOP_K, FIRM_MEM0_THRESHOLD and
FIRM_MEM0_FIRM_OWNER are still honoured so an existing deployment does not
change behaviour on upgrade.
The deployment is self-hosted with no egress. Business rules like "MCX orders always route through Risk Engine A" are closer to strategy IP than to code comments, and the pool inherits the union of access control across every repo feeding it.
Layout
src/firm_memory/
├── models.py canonical Memory · status · tier
├── taxonomy.py the firm's vocabulary and its exclusions
├── scope.py firm / domains / repos
├── provenance.py where a memory came from
├── lifecycle.py approval policy and status transitions
├── memory.py the API agents and applications import
├── config.py platform settings
├── metrics.py failure and latency counters
├── repo.py deterministic repo identity
├── providers/
│ ├── base.py the interface: insert · search · get · update
│ ├── registry.py configuration-driven selection
│ ├── inmemory.py dependency-free provider for tests and local use
│ └── mem0/ namespace · filters · mapping · settings · provider
├── ingestion/
│ ├── approval.py the human gate
│ └── store.py where candidates wait
└── mcp/
├── tools.py the four tools (no SDK dependency)
└── server.py thin transport adapter
tests/
├── unit/ modules in isolation
├── integration/ the API across layers, incl. provider swap
├── contract/ against the real mem0 filter pipeline
└── mcp/ the agent-facing surfaceDevelopment
.venv/bin/python -m pytest -q # 261 tests (1 skipped without the mcp extra)
.venv/bin/python -m pytest --cov --cov-report=term # 94% coverage
.venv/bin/python -m ruff check src testsThe contract tests are the ones to watch. They run our filters through
mem0's real preprocessing and pgvector's SQL builder, pinning constraints found
by reading its source — flat OR branches, flat metadata keys, list values
meaning one of, and the top-level entity key Memory.search requires. If a
mem0 upgrade breaks one, they fail loudly instead of the pool quietly going
empty.
This server cannot be installed
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Related MCP Servers
- AlicenseNot gradedqualityBmaintenanceEnables AI agents to capture, store, and retrieve durable learnings from projects via MCP tools, providing a queryable memory of product and technical lessons across repos.MIT
- AlicenseNot gradedqualityDmaintenanceEnables AI agents to persistently store and semantically search shared knowledge via MCP tools.2MIT
- AlicenseCqualityBmaintenanceEnables governance of AI-agent memory through deterministic routing, explicit ownership, review before promotion, scope-aware retrieval, conflict handling, and auditable receipts via seven MCP tools.72MIT
- AlicenseNot gradedqualityBmaintenanceProvides coding agents with governed semantic memory and code-graph context via MCP, enabling code-linked recall, blast-radius impact analysis, and lifecycle-aware memory management.2Apache 2.0
Related MCP Connectors
Shared, governed long-term memory for AI agents across tools and sessions via MCP and REST.
Your memory, everywhere AI goes. Build knowledge once, access it via MCP anywhere.
Shared, peer-validated knowledge archive for AI agents — search, contribute, and validate via MCP
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/ashish-ty/firm-memory'
If you have feedback or need assistance with the MCP directory API, please join our Discord server