Skip to content

feat(sdk): add ask() method to MemWal and MemWalMock (#1067) - #1345

Open
harrymove-ctrl wants to merge 2 commits into
devfrom
feat/issue-1067-ts-sdk-ask
Open

harrymove-ctrl wants to merge 2 commits into
devfrom
feat/issue-1067-ts-sdk-ask

Conversation

@harrymove-ctrl

Copy link
Copy Markdown
Collaborator

Summary

Implements ask() on both MemWal and MemWalMock in @mysten-incubation/memwal so TypeScript SDK consumers can query POST /api/ask directly with parity alongside the Python SDK and Rust relayer.

  • Added AskMemory, AskResult, AskOptions, and AskParams to packages/sdk/src/types.ts and exported them from packages/sdk/src/index.ts.
  • Implemented MemWal.ask() in packages/sdk/src/memwal.ts supporting both object-style ask({ question, limit, namespace, scoringWeights, timeoutMs }) and positional ask(question, limit?, namespace?) / ask(question, options?).
  • Validated question (non-blank), limit (positive integer, default 5), scoringWeights (finite numbers), and response memories array shape before returning.
  • Implemented MemWalMock.ask() in packages/sdk/src/mock.ts with identical input validation and deterministic offline recall synthesis.
  • Added unit tests in packages/sdk/test/ask.test.mjs and updated packages/sdk/README.md.

Fixes #1067

Verification

  • pnpm --filter @mysten-incubation/memwal build
  • pnpm --filter @mysten-incubation/memwal test (375/375 tests passing)

@harrymove-ctrl

Copy link
Copy Markdown
Collaborator Author

Rebased onto latest dev to resolve mock client validation conflict with PR #1342. All 393 SDK unit and integration tests pass.

@harrymove-ctrl
harrymove-ctrl force-pushed the feat/issue-1067-ts-sdk-ask branch from e697338 to f0674fe Compare November 4, 2026 18:59
@harrymove-ctrl

Copy link
Copy Markdown
Collaborator Author

Rebased onto dev cleanly. All 393 TypeScript SDK tests pass. Ready for review.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug] TypeScript SDK has no ask() binding — /api/ask is advertised by /health and implemented in the Python SDK, but unreachable from TS

1 participant