Skip to content

feat: add Chat SDK integration for persistent chat bot memory#442

Open
benfrank241 wants to merge 1 commit intomainfrom
feat/chat-sdk-integration
Open

feat: add Chat SDK integration for persistent chat bot memory#442
benfrank241 wants to merge 1 commit intomainfrom
feat/chat-sdk-integration

Conversation

@benfrank241
Copy link
Contributor

Summary

  • Adds @vectorize-io/hindsight-chat, a wrapper for the Vercel Chat SDK that gives any chat bot long-term memory via Hindsight
  • withHindsightChat() wraps onNewMention / onSubscribedMessage handlers with automatic recall, retain, and memory formatting
  • Platform-agnostic: works with Slack, Discord, Teams, Google Chat — any Chat SDK adapter
  • Follows the same pattern as the CrewAI and Pydantic AI integrations under hindsight-integrations/

What's included

  • src/wrapper.tswithHindsightChat() handler wrapper with auto-recall before handler, optional auto-retain of inbound messages, and manual ctx.retain() / ctx.recall() / ctx.reflect()
  • src/format.tsmemoriesAsSystemPrompt() formats recalled memories + entity observations into an LLM system prompt
  • src/types.tsHindsightClient interface, ChatMessage / ChatThread types, all configuration options
  • Tests — Unit tests for both wrapper and format utilities

Test plan

  • Unit tests pass (vitest)
  • Verified end-to-end with a Slack + Discord test bot sharing a single memory bank — memory stored in Slack was recalled in Discord and vice versa

🤖 Generated with Claude Code

Adds @vectorize-io/hindsight-chat, a wrapper for the Vercel Chat SDK
that gives any chat bot (Slack, Discord, Teams, etc.) long-term memory
via Hindsight. Includes withHindsightChat() handler wrapper with
auto-recall, auto-retain, and memoriesAsSystemPrompt() formatting.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
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