@ponraaj/dimple-sdk 0.0.0-alpha.7 → 0.0.0-alpha.9

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
@@ -11,7 +11,7 @@ CPU, SQLite files on disk.
11
11
  > **Package**: [npmx.dev/package/@ponraaj/dimple](https://npmx.dev/package/@ponraaj/dimple) ·
12
12
  > **Status**: alpha (`0.0.0-alpha.n`) — the API is stabilizing.
13
13
 
14
- This is the programmatic SDK. The [`@ponraaj/dimple`](https://www.npmjs.com/package/@ponraaj/dimple)
14
+ This is the programmatic SDK. The [`@ponraaj/dimple`](https://npmx.dev/package/@ponraaj/dimple)
15
15
  CLI is a thin facade over it.
16
16
 
17
17
  ## Install
@@ -54,18 +54,19 @@ promise with a closed `_tag` (`"Sdk.NotFound"`, `"Sdk.InputError"`, …);
54
54
 
55
55
  ## API surface
56
56
 
57
- | Method | What it does |
58
- | --------------------------------------------------------- | --------------------------------------------------------- |
59
- | `write(input, { embed })` | Store a memory (idempotent per `logicalKey`) |
60
- | `get(id)` / `forget(id)` | Fetch / remove by id or logical key |
61
- | `query(text, options)` | Hybrid search — profiles, budgets, content-type filter |
62
- | `updateEmbedding(id, vec, modelKey?)` | Attach an external embedding |
63
- | `index({ paths })` | Codebase ingestion (idempotent re-index) |
64
- | `graph.addEdge/confirm/reject/expire/candidates/coverage` | Memory relationships: supports / supersedes / contradicts |
65
- | `explain({ kind, id }, options)` | Bounded graph neighborhood |
66
- | `dream(modelKey?)` / `repair(modelKey?)` | Consolidation + maintenance jobs |
67
- | `health(modelKey?)` | Topic-tree invariant health |
68
- | `reload(input?)` | Blue-green config reload |
57
+ | Method | What it does |
58
+ | --------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
59
+ | `write(input, { embed })` | Store a memory (idempotent per `logicalKey`) |
60
+ | `writeMany(units, { embed })` | Bulk ingest: batch insert + batch embed + routing in one pass (skips the per-write candidate scan — quadratic under bulk; run the dream job afterwards for graph edges) |
61
+ | `get(id)` / `forget(id)` | Fetch / remove by id or logical key |
62
+ | `query(text, options)` | Hybrid search — profiles, budgets, content-type filter |
63
+ | `updateEmbedding(id, vec, modelKey?)` | Attach an external embedding |
64
+ | `index({ paths })` | Codebase ingestion (idempotent re-index) |
65
+ | `graph.addEdge/confirm/reject/expire/candidates/coverage` | Memory relationships: supports / supersedes / contradicts |
66
+ | `explain({ kind, id }, options)` | Bounded graph neighborhood |
67
+ | `dream(modelKey?)` / `repair(modelKey?)` | Consolidation + maintenance jobs |
68
+ | `health(modelKey?)` | Topic-tree invariant health |
69
+ | `reload(input?)` | Blue-green config reload |
69
70
 
70
71
  Errors are a closed hierarchy (`InputError`, `NotFound`, `DuplicateKey`,
71
72
  `JobFailed`, `LLMNotConfigured`, `StoreFailure`) — see the docs site.
@@ -76,22 +77,22 @@ Errors are a closed hierarchy (`InputError`, `NotFound`, `DuplicateKey`,
76
77
  except `embedding`. `dimple init` (CLI) writes the full annotated schema;
77
78
  `${ENV_VAR}` placeholders keep tokens out of files. The complete reference
78
79
  (store / jobs / embeddings / topics / graph / llm / logging / Turso) is on
79
- the docs site: [Configuration reference](https://dimple.ponraaj.me/reference/config).
80
+ the docs site: [Configuration reference](https://dimple.ponraaj.me/reference/config/).
80
81
 
81
82
  ## MCP server
82
83
 
83
84
  `dimple mcp` (from the CLI package) exposes dimple to any MCP client over
84
85
  the 2026-07-28 protocol — API discovery plus sandboxed code execution with
85
86
  the whole API as a `dimple` namespace. Guide:
86
- [MCP server & code mode](https://dimple.ponraaj.me/guides/mcp).
87
+ [MCP server & code mode](https://dimple.ponraaj.me/guides/mcp/).
87
88
 
88
89
  ## Agent integration patterns
89
90
 
90
91
  Session-start injection, the supersedes recipe, and namespaces as the
91
- code/message partition are covered on the docs site (Architecture section)
92
- and in `docs/MCP.md` in the repository.
92
+ code/message partition are covered in the Architecture section of the
93
+ docs site.
93
94
 
94
95
  ## Changelog
95
96
 
96
- [Release history](https://dimple.ponraaj.me/changelog/sdk) · repository
97
+ [Release history](https://dimple.ponraaj.me/changelog/sdk/) · repository
97
98
  [`CHANGELOG.md`](./CHANGELOG.md)
package/dist/dimple.d.ts CHANGED
@@ -22,6 +22,10 @@ export interface QueryOptions {
22
22
  * or `["text/plain", "text/markdown"]`) — the code-vs-message
23
23
  * separation lever at query time. */
24
24
  readonly contentType?: string | readonly string[];
25
+ /** Include the 384-float embedding on result memories (default false —
26
+ * search results never need vectors; the opt-in exists for callers that
27
+ * do post-processing with them). */
28
+ readonly includeEmbedding?: boolean;
25
29
  /** Retrieval context budget (LLM-facing guardrail): `maxUnits` caps the
26
30
  * row count, `maxChars` truncates result content to fit the total char
27
31
  * budget, `maxMs` marks the result truncated when the query exceeds it.
@@ -117,6 +121,12 @@ export interface Dimple {
117
121
  * `stats` use when no model is passed. */
118
122
  readonly defaultModelId: string;
119
123
  readonly write: (input: WriteMemoryInput, options?: WriteOptions) => Promise<MemoryUnit>;
124
+ /** Bulk write: batch insert + batch embed + topic routing in ONE pass.
125
+ * Skips the per-write graph candidate scan (O(leaf size) per write —
126
+ * quadratic under bulk ingest); callers that need near-duplicate/
127
+ * conflict edges on bulk content should run the dream job afterwards.
128
+ * All-or-nothing: a duplicate logical key rejects the whole batch. */
129
+ readonly writeMany: (units: readonly WriteMemoryInput[], options?: WriteOptions) => Promise<readonly MemoryUnit[]>;
120
130
  readonly get: (id: string) => Promise<MemoryUnit>;
121
131
  readonly query: (text: string, options?: QueryOptions) => Promise<AugmentedMemory[]>;
122
132
  readonly forget: (id: string) => Promise<void>;