Skip to main content

langchain-hippodid

Persistent character memory for LangChain agents — powered by HippoDid.

Add cloud-persistent, character-scoped memory to any LangChain chain in a few lines.

Install

pip install langchain-hippodid

Quick Start

from langchain_anthropic import ChatAnthropic
from langchain_core.prompts import ChatPromptTemplate, MessagesPlaceholder
from langchain_core.runnables.history import RunnableWithMessageHistory
from langchain_hippodid import HippoDidMemory

memory = HippoDidMemory(api_key="hd_...", character_id="your-character-uuid")

prompt = ChatPromptTemplate.from_messages([
    ("system", "You are a helpful assistant."),
    MessagesPlaceholder(variable_name="history"),
    ("human", "{input}"),
])

chain_with_memory = RunnableWithMessageHistory(
    prompt | ChatAnthropic(model="claude-sonnet-4-20250514"),
    memory.get_history,
    input_messages_key="input",
    history_messages_key="history",
)

chain_with_memory.invoke(
    {"input": "My name is Yang, I'm building SameThoughts"},
    config={"configurable": {"session_id": "default"}},
)
# Memory persists to HippoDid cloud — survives restarts, redeploys, everything.

Why HippoDid?

Feature Default LangChain HippoDidMemory
Persistence In-process only Cloud-persistent across sessions
Scope Global Character-scoped (one per user)
Retrieval Flat chat log Semantic search across structured categories
Context assembly Append all messages Profile + category summaries + relevant facts
LLM provider N/A Works with any provider (BYOK)

External ID Pattern — One Character Per User

Auto-create and resolve characters by your system's user ID:

from langchain_hippodid import HippoDidMemory

def get_memory(user_id: str) -> HippoDidMemory:
    return HippoDidMemory(
        api_key="hd_...",
        external_id=user_id,  # Auto-creates character if first time
    )

memory = get_memory("user_yang_001")

Memory Modes

Mode Behavior Best For
VERBATIM Stores exact message text, zero AI cost Chat history replay
EXTRACTED AI extracts structured facts via AUDN pipeline Long-term user knowledge
HYBRID Both verbatim archive and extracted facts Full fidelity + structured recall
memory = HippoDidMemory(
    api_key="hd_...",
    character_id="...",
    memory_mode="EXTRACTED",
)

Advanced: Custom Search & Context Assembly

Use HippoDidChatMessageHistory directly for fine-grained control:

from langchain_hippodid import HippoDidChatMessageHistory

history = HippoDidChatMessageHistory(
    api_key="hd_...",
    character_id="your-character-uuid",
)

# Semantic search across memories
results = history.search("travel preferences", top_k=5)

# Assemble full context (profile + memories) for a system prompt
context = history.get_context("current user preferences")

Metadata

Release files for langchain-hippodid 0.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for langchain-hippodid 0.1.0
File Size Uploaded Provenance Actions
langchain_hippodid-0.1.0.tar.gz 13.4 kB With provenance Details for langchain_hippodid-0.1.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for langchain-hippodid 0.1.0
File Interpreter ABI Platform Actions
langchain_hippodid-0.1.0-py3-none-any.whl Python 3 none any Details for langchain_hippodid-0.1.0-py3-none-any.whl

Total release size: 24.0 kB

Release files / langchain_hippodid-0.1.0.tar.gz

Download URL langchain_hippodid-0.1.0.tar.gz
Size 13.4 kB
Tags Source
SHA-256 checksum
How to use checksums
589705d46eea4b62ec7e4d45b6177eac89379c389b99ad5a382d5ae6432fcae7
BLAKE2b-256 checksum
How to use checksums
813f9b91f944aed632f5212ca545fc6aac80642bddfc2d0bdea4b5e25e3a78f4
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.7

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Apr 6, 2026.

Transparency log

Release files / langchain_hippodid-0.1.0-py3-none-any.whl

Download URL langchain_hippodid-0.1.0-py3-none-any.whl
Size 10.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
71785230cde0ff3c7b7790064a4b4abc88bda16b47870d1c8a1ceaa17108c94e
BLAKE2b-256 checksum
How to use checksums
2978dd04ab6bbb02b26858254be664532c3777290969b96cefcbd2565a29a83a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.7

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Apr 6, 2026.

Transparency log

Security for langchain-hippodid 0.1.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for langchain_hippodid-0.1.0.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Apr 6, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 release files Full provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page