Skip to content

Commit 247f45f

Browse files
nTEG-devClaudeclaude
authored
docs: add FAQ page with 11 questions (#14)
Covers SCARs, integration, LLM compatibility, memory clutter, first SCAR creation, enforcement, offline/on-prem, project switching, data export, prompting, and multi-agent memory sharing. Co-authored-by: Claude <claude@nteg.com> Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
1 parent ff661e0 commit 247f45f

File tree

2 files changed

+271
-0
lines changed

2 files changed

+271
-0
lines changed

apps/docs/content/docs/faq.mdx

Lines changed: 270 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,270 @@
1+
---
2+
title: FAQ
3+
description: Common questions about GitMem — what it is, how it works, and how to get started.
4+
---
5+
6+
### What exactly is a SCAR, and how is it different from regular notes or logs?
7+
8+
A SCAR is a structured lesson learned from a mistake, captured in a format that AI agents can act on. Unlike notes or logs, SCARs are:
9+
10+
- **Searchable by intent** — When your agent calls `recall("deploy to production")`, GitMem surfaces SCARs about deployment failures, not just text matching the word "deploy"
11+
- **Self-moderating** — Every SCAR requires at least two counter-arguments: reasons someone might reasonably ignore it. This prevents memory from becoming a rigid rule book
12+
- **Severity-ranked**`critical`, `high`, `medium`, or `low` determines surfacing priority
13+
- **Actionable** — The agent must explicitly respond with `APPLYING`, `N_A`, or `REFUTED` before proceeding
14+
15+
```json
16+
{
17+
"learning_type": "scar",
18+
"title": "Done != Deployed != Verified Working",
19+
"description": "Marking a task done after committing is not enough. Full loop: commit → push → deploy → verify running.",
20+
"severity": "high",
21+
"counter_arguments": [
22+
"For local-only changes, deployment verification is unnecessary",
23+
"In CI/CD pipelines, deployment may be automatic"
24+
]
25+
}
26+
```
27+
28+
SCARs are one of four learning types. **Wins** capture what worked well, **patterns** capture reusable strategies, and **decisions** record architectural choices with rationale. All four surface through the same `recall` mechanism.
29+
30+
> *Deep dive: [SCARs](/docs/concepts/scars) · [Learning Types](/docs/concepts/learning-types)*
31+
32+
---
33+
34+
### How does GitMem integrate with my existing tools like Claude Code or Cursor?
35+
36+
One command:
37+
38+
```bash
39+
npx gitmem-mcp init
40+
```
41+
42+
The interactive wizard detects your environment and configures everything:
43+
44+
| Environment | What `init` does |
45+
|-------------|------------------|
46+
| **Claude Code** | Adds gitmem to `.mcp.json`, creates `CLAUDE.md` with memory protocol, sets up lifecycle hooks in `.claude/settings.json` |
47+
| **Cursor** | Adds gitmem to `.cursor/mcp.json`, creates `.cursorrules` with memory protocol |
48+
| **Claude Desktop** | Adds gitmem to `claude_desktop_config.json` |
49+
| **Windsurf** | Adds gitmem to `mcp_config.json`, creates `.windsurfrules` |
50+
51+
GitMem runs as an [MCP server](https://modelcontextprotocol.io) — a standard protocol that all these tools already support. No plugins, no extensions, no custom integrations. If your tool speaks MCP, GitMem works with it.
52+
53+
Already have existing config files? The wizard merges without overwriting. Re-running is safe — completed steps are skipped.
54+
55+
> *Deep dive: [Installation](/docs/getting-started/installation) · [Configuration](/docs/getting-started/configuration)*
56+
57+
---
58+
59+
### Does GitMem work across different LLMs, or is it locked to one provider?
60+
61+
GitMem is model-agnostic. It works with any LLM that connects through an MCP-compatible client.
62+
63+
The memory is stored as structured data (JSON files in `.gitmem/`), not as model-specific embeddings or prompts. Switch from Claude to GPT to Gemini to a local model — your SCARs, wins, and patterns carry over unchanged.
64+
65+
What matters is the **client**, not the model:
66+
- Claude Code, Cursor, Windsurf, Claude Desktop → all supported via MCP
67+
- Any custom client that implements the [MCP specification](https://modelcontextprotocol.io) → works
68+
69+
You can even switch models between sessions. The institutional memory is the same; the model consuming it is irrelevant.
70+
71+
---
72+
73+
### How does GitMem prevent memory from becoming cluttered over time?
74+
75+
Three mechanisms:
76+
77+
**Counter-arguments:** Every SCAR requires reasons it might not apply. This isn't decoration — it forces the creator to think about when the lesson is irrelevant, and gives future agents legitimate grounds to mark it `N_A`.
78+
79+
**Manual archiving:** The `archive_learning` tool removes a SCAR from recall results while preserving it for audit:
80+
81+
```
82+
archive_learning(id: "abc-123", reason: "superseded by new deploy pipeline")
83+
```
84+
85+
**Behavioral decay:** SCARs that keep getting dismissed naturally fade in recall ranking. GitMem tracks how agents respond to each SCAR — if a SCAR is consistently marked `N_A` or `REFUTED`, its relevance score decreases over time. No manual cleanup needed; unused lessons organically lose priority.
86+
87+
The combination means memory stays relevant without active curation. High-value SCARs that agents keep applying rise to the top. Stale or overly-specific SCARs sink.
88+
89+
> *Deep dive: [SCARs](/docs/concepts/scars) · [Sessions](/docs/concepts/sessions)*
90+
91+
---
92+
93+
### How do I add my first SCAR, and what does the process look like?
94+
95+
**Option A: Let `init` seed starter SCARs (fastest)**
96+
97+
```bash
98+
npx gitmem-mcp init
99+
```
100+
101+
This creates 3 starter SCARs based on common AI agent failure patterns. You'll see them surface on your very first `recall`.
102+
103+
**Option B: Create one manually during a session**
104+
105+
After something goes wrong (or right), tell your agent to capture it:
106+
107+
> "That deployment failure should be a SCAR — capture it."
108+
109+
Your agent calls `create_learning`:
110+
111+
```
112+
create_learning(
113+
learning_type: "scar",
114+
title: "Database migrations require --dry-run first",
115+
description: "Running db push without --dry-run applied a destructive migration to production. Always preview changes before applying.",
116+
severity: "high",
117+
counter_arguments: [
118+
"In development environments, dry-run adds unnecessary friction",
119+
"Idempotent migrations (ADD COLUMN IF NOT EXISTS) are safe without preview"
120+
]
121+
)
122+
```
123+
124+
**Option C: Session closing ceremony (most common in practice)**
125+
126+
Most SCARs are born during the closing ceremony. When you say "closing" or "done for now", GitMem prompts reflection questions: *What broke? What took longer than it should? What would you do differently?* The answers become SCARs and wins.
127+
128+
> *Deep dive: [Your First Session](/docs/getting-started/first-session) · [Closing Ceremony](/docs/guides/closing-ceremony)*
129+
130+
---
131+
132+
### What happens if my agent skips the recall step?
133+
134+
GitMem includes a server-side enforcement layer that catches protocol violations with advisory warnings.
135+
136+
**If your agent tries to create a SCAR, log a decision, or close a session without calling `recall` first:**
137+
138+
```
139+
--- gitmem enforcement ---
140+
No recall() was run this session before this action.
141+
Consider calling recall() first to check for relevant institutional memory.
142+
Past mistakes and patterns may prevent repeating known issues.
143+
---
144+
```
145+
146+
**If your agent called `recall` but didn't confirm the surfaced SCARs:**
147+
148+
```
149+
--- gitmem enforcement ---
150+
3 recalled scar(s) await confirmation.
151+
Call confirm_scars() with APPLYING/N_A/REFUTED for each before proceeding.
152+
---
153+
```
154+
155+
These warnings are **advisory, not blocking**. The tool still executes — GitMem never prevents your agent from working. But the warnings are visible in the response, which nudges the agent back on track.
156+
157+
For Claude Code users, the optional lifecycle hooks provide additional nudges: a `PreToolUse` hook reminds the agent to recall if it hasn't yet, and a `Stop` hook triggers the closing ceremony before the session ends.
158+
159+
> *Deep dive: [Closing Ceremony](/docs/guides/closing-ceremony)*
160+
161+
---
162+
163+
### Can I use GitMem offline or on-prem for security reasons?
164+
165+
Yes. GitMem is **completely local** — no network calls, no accounts, no telemetry, no data leaving your machine.
166+
167+
```
168+
.gitmem/
169+
├── learnings.json # Your SCARs, wins, patterns
170+
├── sessions.json # Session history
171+
├── threads.json # Open work items
172+
└── decisions.json # Architectural decisions
173+
```
174+
175+
Everything is plain JSON in a `.gitmem/` directory inside your project. You can read it, version-control it, back it up, or delete it. There is no phone-home, no analytics collection, and no external dependency.
176+
177+
**For air-gapped or on-prem environments:**
178+
- Install from a local npm registry or tarball: `npm install ./gitmem-mcp-x.y.z.tgz`
179+
- All search runs locally (keyword matching, no external API)
180+
- No internet connection needed after install
181+
182+
> *Deep dive: [Local Storage](/docs/concepts/local-storage)*
183+
184+
---
185+
186+
### What happens if I switch projects or teams — does my memory persist?
187+
188+
Memory is **per-project by default**. Each project has its own `.gitmem/` directory with its own SCARs, threads, and session history.
189+
190+
```
191+
~/project-a/.gitmem/ # Project A's memory
192+
~/project-b/.gitmem/ # Project B's memory (separate)
193+
```
194+
195+
This is intentional — a SCAR about "always run migrations with --dry-run" in your backend project shouldn't surface when you're writing CSS in a frontend project.
196+
197+
**Switching machines:** Memory lives in `.gitmem/` on the machine where you created it. To move memory between machines, copy the `.gitmem/` directory or commit it to version control alongside your project.
198+
199+
> *Deep dive: [Local Storage](/docs/concepts/local-storage)*
200+
201+
---
202+
203+
### How do I export my data if I decide to stop using GitMem?
204+
205+
All your data is already in plain JSON files you own.
206+
207+
Copy `.gitmem/` — that's everything. The files are human-readable:
208+
209+
```bash
210+
# See all your SCARs
211+
cat .gitmem/learnings.json | jq '.[] | {title, severity, learning_type}'
212+
213+
# See session history
214+
cat .gitmem/sessions.json | jq '.[0] | {started_at, decisions, reflection}'
215+
```
216+
217+
**To fully remove GitMem:**
218+
219+
```bash
220+
# Remove local data
221+
rm -rf .gitmem/
222+
223+
# Remove from MCP config (Claude Code)
224+
# Delete the "gitmem" entry from .mcp.json
225+
226+
# Remove CLAUDE.md section (between gitmem:start and gitmem:end markers)
227+
```
228+
229+
There is no lock-in. No proprietary format. No "export request" workflow. The data is yours — always readable, always portable.
230+
231+
---
232+
233+
### Do I need to change how I prompt my agent?
234+
235+
No. The `init` wizard adds memory instructions to your agent's system prompt file (`CLAUDE.md`, `.cursorrules`, or `.windsurfrules`). Your agent picks up the recall → confirm → close protocol automatically.
236+
237+
In practice, this means:
238+
- **Session start** happens automatically (via hooks or agent initiative)
239+
- **Recall** fires before consequential actions — the agent does this on its own
240+
- **Creating SCARs** happens naturally — just say "that should be a SCAR" or let the closing ceremony capture lessons
241+
- **Session close** triggers when you say "done" or "closing"
242+
243+
The only new habit is the closing ceremony: taking 60 seconds at the end of a session to reflect on what happened. That's where most institutional memory is born.
244+
245+
> *Deep dive: [Your First Session](/docs/getting-started/first-session)*
246+
247+
---
248+
249+
### Can multiple agents share the same memory?
250+
251+
Yes — and this happens naturally on a single developer's machine.
252+
253+
**Sub-agents within a session:** When your main agent spawns sub-agents (code reviewers, test runners, researchers), use `prepare_context` to brief them and `absorb_observations` to capture what they find:
254+
255+
```
256+
# Before spawning a sub-agent
257+
prepare_context(plan: "review auth middleware", format: "compact")
258+
# → Returns top SCARs/patterns in ~500 tokens, ready to inject into the sub-agent's prompt
259+
260+
# After sub-agent returns
261+
absorb_observations(observations: [
262+
{ source: "code-review-agent", text: "Found hardcoded API key in config.js", severity: "scar_candidate" }
263+
])
264+
```
265+
266+
**Parallel CLI sessions:** If you run multiple Claude Code sessions against the same project, they all read from the same `.gitmem/` directory. A SCAR created in one terminal is immediately available to `recall` in another. This is the most common multi-agent pattern — one developer, multiple concurrent agents, shared local memory.
267+
268+
**Sequential sessions:** Every session inherits what previous sessions learned. The closing ceremony in session A creates SCARs that `recall` surfaces in session B. No configuration needed — it just works because memory persists in `.gitmem/`.
269+
270+
> *Deep dive: [Multi-Agent Workflows](/docs/guides/multi-agent-workflows)*

apps/docs/content/docs/meta.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
"tools",
77
"guides",
88
"examples",
9+
"faq",
910
"contributing",
1011
"changelog"
1112
]

0 commit comments

Comments
 (0)