|
3 | 3 | Shared memory layer for AI-powered engineering teams. Built on |
4 | 4 | [QMD](https://github.com/tobi/qmd). |
5 | 5 |
|
| 6 | +## Memory |
| 7 | + |
| 8 | +You have Smriti. USE IT. |
| 9 | + |
| 10 | +### Start of Every Session |
| 11 | + |
| 12 | +Before writing a single line of code, run: |
| 13 | + |
| 14 | +```bash |
| 15 | +smriti recall "[what we're about to work on]" |
| 16 | +``` |
| 17 | + |
| 18 | +Use what comes back. If there's prior context on this topic, it changes how |
| 19 | +you approach the work. Don't ignore it. |
| 20 | + |
| 21 | +### Recognize These Moments — Then Act Immediately |
| 22 | + |
| 23 | +No permission needed. No asking "should I save this?" Just do it. |
| 24 | + |
| 25 | +- Someone says "this works" or "let's go with this" |
| 26 | +- An approach is chosen after comparing options |
| 27 | +- A bug is fixed and the root cause is understood |
| 28 | +- A constraint is discovered that will affect future work |
| 29 | +- An architectural decision is made |
| 30 | + |
| 31 | +**WRONG**: Continue the conversation without saving. |
| 32 | +**RIGHT**: Write the decision record, ingest it, tag it — then respond. |
| 33 | + |
| 34 | +### How to Save a Decision |
| 35 | + |
| 36 | +**Step 1 — Write the record:** |
| 37 | + |
| 38 | +```bash |
| 39 | +cat > /tmp/smriti-note.md << 'EOF' |
| 40 | +# [Title] |
| 41 | +
|
| 42 | +## Decision |
| 43 | +[One sentence — the actual choice made.] |
| 44 | +
|
| 45 | +## Why |
| 46 | +[The reasoning. What was considered. What was ruled out and why.] |
| 47 | +
|
| 48 | +## Context |
| 49 | +[What problem this solves. What breaks if someone reverses this later.] |
| 50 | +EOF |
| 51 | +``` |
| 52 | + |
| 53 | +**Step 2 — Ingest:** |
| 54 | + |
| 55 | +```bash |
| 56 | +smriti ingest file /tmp/smriti-note.md \ |
| 57 | + --title "[Title]" \ |
| 58 | + --project smriti |
| 59 | +``` |
| 60 | + |
| 61 | +**Step 3 — Tag:** |
| 62 | + |
| 63 | +```bash |
| 64 | +smriti tag [session-id] [category] |
| 65 | +``` |
| 66 | + |
| 67 | +### Categories |
| 68 | + |
| 69 | +| What happened | Tag | |
| 70 | +|---------------|-----| |
| 71 | +| Architecture choice, approach finalized | `decision/technical` | |
| 72 | +| Library or tool selected | `decision/tooling` | |
| 73 | +| Bug fixed, root cause identified | `bug/fix` | |
| 74 | +| Structural design settled | `architecture/design` | |
| 75 | +| Feature approach finalized | `feature/implementation` | |
| 76 | +| Config or setup figured out | `project/config` | |
| 77 | + |
| 78 | +### Concrete Example |
| 79 | + |
| 80 | +User says: *"Okay let's use post-filtering for vector search with filters"* |
| 81 | + |
| 82 | +**WRONG**: |
| 83 | +> "Got it, I'll use post-filtering." |
| 84 | +
|
| 85 | +**RIGHT**: |
| 86 | + |
| 87 | +```bash |
| 88 | +cat > /tmp/smriti-note.md << 'EOF' |
| 89 | +# Vector search with filters: post-filter approach |
| 90 | +
|
| 91 | +## Decision |
| 92 | +Use post-filter strategy for applying metadata filters to vector search |
| 93 | +results, rather than combining sqlite-vec queries with EXISTS subqueries. |
| 94 | +
|
| 95 | +## Why |
| 96 | +sqlite-vec's two-step query pattern hangs when combined with Smriti's |
| 97 | +EXISTS subqueries on metadata tables. Post-filtering runs vector search |
| 98 | +unfiltered (3x overfetch), then filters results against session metadata |
| 99 | +in a separate batch lookup — no sqlite-vec changes needed. |
| 100 | +
|
| 101 | +## Context |
| 102 | +Affects smriti recall when --project, --category, or --agent flags are |
| 103 | +used. Without this, filtered recall loses semantic search entirely and |
| 104 | +falls back to BM25 only. |
| 105 | +EOF |
| 106 | + |
| 107 | +smriti ingest file /tmp/smriti-note.md \ |
| 108 | + --title "Vector search with filters: post-filter approach" \ |
| 109 | + --project smriti |
| 110 | + |
| 111 | +smriti tag [session-id] decision/technical |
| 112 | +``` |
| 113 | + |
| 114 | +Then respond to the user. |
| 115 | + |
| 116 | +--- |
| 117 | + |
6 | 118 | ## Quick Reference |
7 | 119 |
|
8 | 120 | ```bash |
@@ -104,7 +216,7 @@ get a clean name like `openfga`. |
104 | 216 | 4. Store message/meta/sidecars/costs (store gateway) |
105 | 217 | 5. Aggregate results and continue on per-session errors (orchestrator) |
106 | 218 |
|
107 | | -See `INGEST_ARCHITECTURE.md` for details. |
| 219 | +See `docs/internal/ingest-architecture.md` for details. |
108 | 220 |
|
109 | 221 | ### Search |
110 | 222 |
|
|
0 commit comments