-
Notifications
You must be signed in to change notification settings - Fork 1
docs: update JavaScript SDK vector delete documentation for bulk delete support #229
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
docs: update JavaScript SDK vector delete documentation for bulk delete support #229
Conversation
…te support - Update vector.delete() method signature to support variadic arguments - Add comprehensive examples showing single and bulk delete patterns - Update vector storage examples to demonstrate bulk deletion - Enhance changelog entry for v0.0.131 with detailed description Reflects changes from commit 6548924bb7bd90b5c71e49c66b6b2a22dd9a885e in sdk-js Co-Authored-By: jhaynie@agentuity.com <jhaynie@gmail.com>
🤖 Devin AI EngineerI'll be helping with this pull request! Here's what you should know: ✅ I will automatically:
Note: I can only respond to comments from users who have write access to this repository. ⚙️ Control Options:
|
WalkthroughThe changes expand documentation and examples for the JavaScript SDK's vector storage bulk delete functionality. The Changes
Sequence Diagram(s)sequenceDiagram
participant User
participant SDK
participant VectorStorage
User->>SDK: delete("products", "id1", "id2", "id3")
SDK->>VectorStorage: Delete vectors with keys "id1", "id2", "id3"
VectorStorage-->>SDK: Number of vectors deleted
SDK-->>User: Promise resolves with deleted count
Possibly related PRs
Suggested reviewers
Poem
✨ Finishing Touches🧪 Generate unit tests
🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
Deploying with
|
Status | Name | Latest Commit | Preview URL | Updated (UTC) |
---|---|---|---|---|
✅ Deployment successful! View logs |
docs | fd7794c | Commit Preview URL | Jul 08 2025, 05:49 AM |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
🧹 Nitpick comments (5)
content/SDKs/javascript/api-reference.mdx (2)
262-270
: Document variadic parameter with back-ticks and clarify behaviour when nothing is deleted
- The second bullet should render the variadic parameter as code (
...keys
), otherwise MDX sometimes interprets the three dots as an ellipsis.- Explicitly state what the promise resolves to when no supplied key exists (0).
This heads-off confusion given the new bulk-delete semantics.- - `keys`: One or more keys of the vectors to delete + - `...keys`: One or more keys of the vectors to delete. + The method resolves to `0` if none of the supplied keys exist.
280-292
: Avoid shadowing & showcase a singledeletedCount
variableEach example re-declares
const deletedCount
, shadowing the previous one inside the same MDX fenced block.
While harmless at runtime (it’s just documentation), lint tooling that parses examples will flag this.-const deletedCount = await context.vector.delete('product-descriptions', 'id1'); +let deletedCount = await context.vector.delete('product-descriptions', 'id1'); … -deletedCount = await context.vector.delete('product-descriptions', 'id1', 'id2', 'id3'); +deletedCount = await context.vector.delete('product-descriptions', 'id1', 'id2', 'id3'); … -deletedCount = await context.vector.delete('product-descriptions', ...keysToDelete); +deletedCount = await context.vector.delete('product-descriptions', ...keysToDelete); … -deletedCount = await context.vector.delete('product-descriptions', 'existing-id', 'non-existent-id'); +deletedCount = await context.vector.delete('product-descriptions', 'existing-id', 'non-existent-id');This small tweak keeps the snippet ESLint-clean while still conveying the intended usage.
content/Changelog/sdk-js.mdx (1)
18-18
: Link to docs PR for cross-traceabilitySince this bullet already references the SDK PR, adding the doc PR (
agentuity/docs#229
) tightens the feedback loop for readers investigating the change.- **Added**: Support for bulk delete in vector storage […] + **Added**: Support for bulk delete in vector storage […] (docs update: [agentuity/docs#229](https://github.com/agentuity/docs/pull/229))content/SDKs/javascript/examples/index.mdx (2)
158-165
: Ensure IDs are strings and guard againstundefined
p.id || p
works, but ifp.id
is a number (common for databases)vector.delete
will receive a mixed array of numbers & strings, which many back-ends treat as distinct types.-const productIds = products.map(p => p.id || p); +const productIds = products.map(p => String(p.id ?? p));Using
String()
guarantees a homogeneousstring[]
and prevents subtle 404s whenid === 0
.
168-170
: Minor wording tweak for consistencyMost earlier responses use past-tense “successfully”. Align this message:
-message: `Deleted ${count} product(s) successfully`, +message: `Deleted ${count} product(s) successfully`,(Just a textual nit – feel free to ignore if style guides differ.)
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (3)
content/Changelog/sdk-js.mdx
(1 hunks)content/SDKs/javascript/api-reference.mdx
(1 hunks)content/SDKs/javascript/examples/index.mdx
(1 hunks)
🧰 Additional context used
🧠 Learnings (1)
content/Changelog/sdk-js.mdx (1)
Learnt from: CR
PR: agentuity/docs#0
File: agent-docs/.cursor/rules/sdk.mdc:0-0
Timestamp: 2025-07-01T12:36:46.237Z
Learning: Applies to agent-docs/src/agents/**/*.ts : Use the storage APIs for persisting data
🪛 LanguageTool
content/SDKs/javascript/api-reference.mdx
[uncategorized] ~268-~268: Loose punctuation mark.
Context: ...tor storage. ##### Parameters - name
: The name of the vector storage - keys
...
(UNLIKELY_OPENING_PUNCTUATION)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
- GitHub Check: Workers Builds: docs
PR description is being written. Please check back in a minute.
Devin Session: https://app.devin.ai/sessions/fff262971a274694854e05177561e1e8
Summary by CodeRabbit