Overview
Every interaction with the LLM Gateway is associated with asessionId. This ID is used to retrieve:
- Cart ID: The current shopping cart for the user.
- Context: Recent interactions, preferences, or user IDs.
- Merchant ID: In multi-vendor environments, the current merchant being interacted with.
Session Storage
By default, the gateway uses an in-memory session manager, which is perfect for development but not suitable for production.Redis (Recommended)
For production, use a Redis-based session manager to ensure high availability and shared state across multiple gateway instances.Creating & Retrieving Sessions
When using the HTTP Adapter, you typically pass thesessionId in the header or as part of the tool execution request.
Cross-Platform Transfer
One of the unique features of the LLM Gateway is the ability to transfer sessions across different AI assistants.- User starts a conversation in Claude and adds items to a cart.
- The user wants to “Checkout on Mobile”.
- The gateway generates a secure transfer link.
- The user opens the link on their phone, and the session (including the cart) is restored.
Best Practices
- Use UUIDs: Always use long, unpredictable strings for session IDs.
- Set TTLs: Configure appropriate time-to-live values based on your user behavior (e.g., 24 hours for carts).
- Secure Handling: Treat session IDs like sensitive data, as they provide access to a user’s cart.