Topic

Durable Memory

All digests tagged Durable Memory

HTTP Channels for Managed Deep Agents thumbnail

· 8:27

HTTP Channels for Managed Deep Agents

This session details the implementation of custom HTTP channels for Managed Deep Agents, enabling agents to receive inbound requests from external services that are outside the developer's direct control (e.g., HubSpot, Salesforce, or messaging providers like Photon/iMessage). The process involves defining the agent's instructions, integrating durable memory (Context Hub) for state management, and implementing critical functions—`verify` and `parse`—to securely process and extract data from raw inbound events. The architecture ensures the agent can maintain context across multiple user interactions via stable thread IDs.

Key takeaways

  1. Use Case for HTTP Channels

    Custom HTTP channels are necessary when an agent needs to handle inbound requests from external services or platforms where LangChain does not provide a built-in channel (e.g., Slack, HubSpot, or custom RCS/iMessage integrations).

  2. Agent Data Flow and Components

    The agent requires defining instructions, utilizing durable memory (Context Hub) for persistent state (like a ledger), and implementing a custom channel definition that includes `verify` and `parse` functions.

  3. Handling Inbound Messages 0:03

    The `verify` function ensures the incoming request is valid and secure. The `parse` function extracts relevant data (text, images) from the raw event JSON and passes it to the agent.

  4. Maintaining User Context 0:04

    To ensure continuity over time, the agent must manage threads by hashing the inbound message phone number into a UUID, allowing the agent to maintain context across multiple interactions.

  5. Completing the Interaction Loop 0:05

    A `post` hook is required to send the agent's successful response back to the channel provider (e.g., Photon), allowing the user to receive the final text message.

Watch on YouTube Full article