@cachly-dev/mcp-server 0.2.0 → 0.5.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -50,7 +50,7 @@ Once connected, just talk to your AI assistant:
50
50
  | **`recall_best_solution`** | Retrieve the best known solution for a topic (increments recall count). |
51
51
  | **`remember_context`** | Cache any analysis or architecture finding for future sessions. |
52
52
  | **`recall_context`** | Retrieve cached context by exact key (supports glob: `"file:*"`). |
53
- | **`smart_recall`** | Semantic search across all cached context by meaning/keywords. |
53
+ | **`smart_recall`** | BM25+ keyword search across all cached context. Works **without any embedding provider**. Optionally adds semantic vector search if an API key is configured. |
54
54
  | **`list_remembered`** | List all cached context entries. |
55
55
  | **`forget_context`** | Delete stale context. |
56
56
 
@@ -225,23 +225,7 @@ AI: [calls smart_recall("auth")]
225
225
  (No file reading needed — instant answer!)
226
226
  ```
227
227
 
228
- **Setup in 2 minutes:**
229
-
230
- 1. Add to `.github/copilot-instructions.md` (or `CLAUDE.md` for Claude Code):
231
- ```markdown
232
- ## Cachly AI Brain
233
-
234
- At the START of every session:
235
- session_start(instance_id = "<id>", focus = "<what you plan to work on>")
236
-
237
- At the END of every session:
238
- session_end(instance_id = "<id>", summary = "...", files_changed = [...])
239
-
240
- After any bug fix: learn_from_attempts(instance_id = "<id>", topic = "category:keyword",
241
- outcome = "success", what_worked = "...", severity = "major")
242
- ```
243
-
244
- 2. From now on: your AI calls `session_start` first and never re-reads what it already knows.
228
+ The `setup` wizard (see top of this README) writes the session instructions automatically into your `CLAUDE.md` / `.github/copilot-instructions.md` — **no manual editing needed.** Just run `npx @cachly-dev/mcp-server setup` once and your AI assistant calls `session_start` at the start of every session automatically.
245
229
 
246
230
  ### 1. AI-Assisted Development — "Which caches am I using?"
247
231
 
package/dist/index.d.ts CHANGED
@@ -1,2 +1,31 @@
1
1
  #!/usr/bin/env node
2
- export {};
2
+ /**
3
+ * Stopwords — filtered out during tokenization.
4
+ * Covers: English, German, French, Spanish, Italian, Portuguese.
5
+ * Keeps the index small and scores meaningful.
6
+ */
7
+ declare const STOPWORDS: Set<string>;
8
+ /** Tokenize text into meaningful keywords. Handles unicode (accented chars). */
9
+ declare function tokenize(text: string): string[];
10
+ /**
11
+ * Split a multi-topic query into sub-queries.
12
+ * Detects numbered lists, semicolons, "and also", line breaks, etc.
13
+ *
14
+ * Example: "deploy API fix routing and also check auth" →
15
+ * ["deploy API fix routing", "check auth"]
16
+ *
17
+ * Example: "1. deploy 2. fix routing 3. auth" →
18
+ * ["deploy", "fix routing", "auth"]
19
+ */
20
+ declare function splitMultiQuery(query: string): string[];
21
+ /**
22
+ * Levenshtein distance — edit distance between two strings.
23
+ * Used for typo-tolerant fuzzy matching (distance ≤ 2 = match).
24
+ * O(n*m) but strings are short (tokens), so this is fast.
25
+ */
26
+ declare function levenshtein(a: string, b: string): number;
27
+ /** Extract a timestamp from JSON content (looks for "ts" or "created" fields). */
28
+ declare function extractTimestamp(content: string): number | undefined;
29
+ /** Recency multiplier: 1.0 for now, 0.5 after half-life days, exponential decay. */
30
+ declare function recencyBoost(timestampMs: number | undefined): number;
31
+ export { tokenize, splitMultiQuery, levenshtein, recencyBoost, extractTimestamp, STOPWORDS };