Skip to content

feat: replace prompt with query API - #264

Merged
sarahwooders merged 3 commits into
letta/stateless-sessions-eb83f997from
sarah/sdk-query-api
Aug 10, 2026
Merged

feat: replace prompt with query API#264
sarahwooders merged 3 commits into
letta/stateless-sessions-eb83f997from
sarah/sdk-query-api

Conversation

@sarahwooders

Copy link
Copy Markdown
Contributor

Summary

  • replace prompt() with a Claude Agent SDK-shaped query({ prompt, options }) async message stream
  • accept an optional agentId; existing agents receive a fresh conversation, while omitted IDs create a hidden non-MemFS agent and force stateless execution
  • support AsyncIterable<SendMessage> for multi-turn queries and close the underlying session when iteration completes or stops
  • stacked on feat: add stateless agent sessions #262, which adds the stateless session transport behavior

Test plan

  • bun run check
  • bun test
  • bun run build
  • live Cloud query without agentId returned QUERY_OK from a hidden stateless agent

👾 Generated with Letta Code

Align one-shot and streaming calls with the Claude Agent SDK shape while preserving Letta agent identity when supplied and creating hidden stateless workers otherwise.

See [trace](https://app.letta.com/chat/agent-57231da8-42f3-4523-b190-66c3eda21057?conversation=conv-ef0008da-f395-4fe3-960f-4ee31ea3c3fb). Resume conversation with `letta --conv conv-ef0008da-f395-4fe3-960f-4ee31ea3c3fb`

👾 Generated with [Letta Code](https://letta.com)

Co-Authored-By: Letta Code <noreply@letta.com>
@sarahwooders
sarahwooders marked this pull request as ready for review August 10, 2026 20:53
Bob and others added 2 commits August 10, 2026 14:08
Expose familiar query lifecycle controls and consume async prompts concurrently so callers can inject work while a turn is active. Keep model-selected queries stateless by requiring persistent-agent calls to use the agent configuration unchanged.

See [trace](https://app.letta.com/chat/agent-57231da8-42f3-4523-b190-66c3eda21057?conversation=conv-50816367-009e-4137-b7b2-c4fc55674cb9). Resume conversation with `letta --conv conv-50816367-009e-4137-b7b2-c4fc55674cb9`

👾 Generated with [Letta Code](https://letta.com)

Co-Authored-By: Letta Code <noreply@letta.com>
Allow model selection when querying an existing agent because the new conversation owns the override, and simplify the public documentation around query behavior.

See [trace](https://app.letta.com/chat/agent-57231da8-42f3-4523-b190-66c3eda21057?conversation=conv-50816367-009e-4137-b7b2-c4fc55674cb9). Resume conversation with `letta --conv conv-50816367-009e-4137-b7b2-c4fc55674cb9`

👾 Generated with [Letta Code](https://letta.com)

Co-Authored-By: Letta Code <noreply@letta.com>
@sarahwooders
sarahwooders merged commit cf88d96 into letta/stateless-sessions-eb83f997 Aug 10, 2026
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.

1 participant