Skip to main content
Stores and retrieves a chat’s message history and tools configuration.

Constructor

Methods

  • getContext(chatId): Promise<{ messages, toolsConfig }>
  • clearContext(chatId): Promise<void>
  • setMessages(chatId, messages): Promise<void>
  • appendMessages(chatId, messages): Promise<void>
  • setToolsConfig(chatId, toolsConfig): Promise<void>
  • deleteContext(chatId): Promise<void>
Notes:
  • clearContext resets message history and tools config to defaults for a chat but keeps the chat ID registered. Use deleteContext to remove everything including the cache entry.
  • The manager deep‑clones stored data to avoid accidental mutation by callers.

Example