Borrowing it
Nothing to install: this file belongs to tostechbr/memoryClaw. Take a copy, put it at the same path in your own repository, and replace the rules that are about this project with yours.
curl -O https://raw.githubusercontent.com/tostechbr/memoryClaw/main/.claude/skills/vector-search-patterns/SKILL.mdgit clone --depth 1 https://github.com/tostechbr/memoryClawWrote this? Show the measurements
A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.
[](https://agentmods.dev/skills/tostechbr/memoryclaw/vector-search-patterns)<a href="https://agentmods.dev/skills/tostechbr/memoryclaw/vector-search-patterns"><img src="https://agentmods.dev/badge/skills/tostechbr/memoryclaw/vector-search-patterns/github.svg" alt="Measured on agentmods" height="20"></a>Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.
<a href="https://agentmods.dev/skills/tostechbr/memoryclaw/vector-search-patterns"><img src="https://agentmods.dev/badge/skills/tostechbr/memoryclaw/vector-search-patterns.svg" alt="Reviewed on agentmods" width="80" height="20"></a>What it costs to keep this loaded
Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5.1 | $0.00042 | $0.01181 |
| Opus 5.5 | $0.00017 | $0.00472 |
| Sonnet 5.5 | $0.00008 | $0.00236 |
| Haiku 4.5 | $0.00004 | $0.00118 |
Grade A, and why
vector-search-patterns scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 2mo ago.
A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.
Nothing flagged
None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.
How it starts
The opening of the file, as written. The whole thing — 146 lines — stays where its author put it; the contents beside it link to each section on GitHub.
Vector Search Patterns — Akashic Context Sprint 1
Design Decision (D1)
No sqlite-vec extension. Cosine similarity implemented in TypeScript directly.
Why: Embeddings already stored as JSON in chunks.embedding column. sqlite-vec has platform loading issues. In-process is sufficient for ~2000 chunks/user.
cosine Similarity Function
Add as module-level function in storage.ts (NOT exported — internal utility):
function cosineSimilarity(a: number[], b: number[]): number {
let dot = 0, magA = 0, magB = 0;
for (let i = 0; i < a.length; i++) {
dot += a[i] * b[i];
magA += a[i] * a[i];
magB += b[i] * b[i];
}
const mag = Math.sqrt(magA) * Math.sqrt(magB);
if (mag === 0) return 0;
return dot / mag;
}
Mathematical properties (use in tests):
cosineSimilarity([1,0], [1,0])→1.0(identical)cosineSimilarity([1,0], [0,1])→0.0(orthogonal)cosineSimilarity([1,0], [-1,0])→-1.0(opposite)
searchVectorInProcess() in storage.ts
Add alongside existing searchVector() method:
searchVectorInProcess(params: SearchVectorParams): VectorSearchResult[] {
let sql = `
SELECT id, path, source, start_line as startLine, end_line as endLine, text, embedding
FROM chunks
`;
const queryParams: unknown[] = [];
if (params.source) {
sql += " WHERE source = ?";
queryParams.push(params.source);
}
const rows = this.db.prepare(sql).all(...queryParams) as Array<{
id: string; path: string; source: string;
startLine: number; endLine: number; text: string; embedding: string;
}>;
const queryEmb = params.embedding;
return rows
.map(row => {
let chunkEmb: number[];
try {
chunkEmb = JSON.parse(row.embedding) as number[];
} catch {
return null;
}
const similarity = cosineSimilarity(queryEmb, chunkEmb);
return {
id: row.id,
path: row.path,
source: row.source,
startLine: row.startLine,
endLine: row.endLine,
text: row.text,
distance: 1 - similarity, // Lower is better (consistent with searchVector interface)
};
})
.filter((r): r is VectorSearchResult => r !== null && r.distance <= (1 - 0.3))
.sort((a, b) => a.distance - b.distance)
.slice(0, params.limit);
}
What this file has done since we first saw it
Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.
- 2mo ago First seen · 146 lines · 42 tokens per session scan A 7a0032a24b6e
vector-search-patterns is a skill published in the GitHub repository tostechbr/memoryClaw (8 stars, last pushed 8mo ago), licensed MIT. It adds 42 tokens to every session and 1,181 once invoked, about $0.0002 per session on Opus 5.5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.
vector-search-patterns compared with skills from other repositories
| Mod | Type | Stars | Last push | Licence | Scan | Tokens | Works with |
|---|---|---|---|---|---|---|---|
| vector-search-patternstostechbr/memoryClaw | Skill | 8 | 8mo ago | MIT | A | 42 | Claude Code |
| migrate-from-ai-sdkDeuz-AI/Deuz-SDK | Skill | 508 | 21d ago | MIT | A | 118 | Claude Code, Codex |
| piznlgis/opengis-skills | Skill | 76 | 10d ago | MIT | B | 103 | Claude Code, Codex |
| mcp-builderalleneee/skill-agent | Skill | 27 | 7mo ago | none | A | 61 | Claude Code |
| memory-rag-poisoning-detectionTencent/AI-Infra-Guard | Skill | 7.4k | yesterday | Apache-2.0 | A | 48 | Claude Code |
| dev-browserMemTensor/MemOS | Skill | 12k | 2d ago | Apache-2.0 | A | 84 | Claude Code, Codex |
| unified-llm-apiPrism-Shadow/penguin-harness | Skill | 3.2k | yesterday | Apache-2.0 | A | 43 | Claude Code, Codex |