From 720da4ae4e053fb6a30c003ada2081e498f78b87 Mon Sep 17 00:00:00 2001 From: Theodoros Nomikos Date: Fri, 29 May 2026 17:08:10 +0300 Subject: [PATCH 1/2] docs: add ThrindexStore LangGraph store integration --- .../python/integrations/stores/thrindex.mdx | 130 ++++++++++++++++++ 1 file changed, 130 insertions(+) create mode 100644 src/oss/python/integrations/stores/thrindex.mdx diff --git a/src/oss/python/integrations/stores/thrindex.mdx b/src/oss/python/integrations/stores/thrindex.mdx new file mode 100644 index 0000000000..f87dbb034c --- /dev/null +++ b/src/oss/python/integrations/stores/thrindex.mdx @@ -0,0 +1,130 @@ +--- +title: "ThrindexStore integration" +description: "Integrate with the ThrindexStore LangGraph store using LangChain Python." +--- + +This guide will help you get started with [Thrindex](https://thrindex.com) as a persistent [LangGraph store](/oss/integrations/stores). For detailed documentation of all `ThrindexStore` features and configurations head to the [langchain-thrindex README](https://pypi.org/project/langchain-thrindex/). + +## Overview + +`ThrindexStore` is a persistent `BaseStore` implementation backed by [Thrindex](https://thrindex.com) — a memory API for AI agents. It stores memories durably and supports native semantic search, so your LangGraph agents can recall relevant facts across sessions without managing embeddings or vector infrastructure. + +Unlike ephemeral stores such as `InMemoryStore`, `ThrindexStore` persists across process restarts and deployments, making it suitable for production agents. + +### Integration details + +| Class | Package | Local | JS support | Downloads | Version | +| :--- | :--- | :---: | :---: | :---: | :---: | +| [`ThrindexStore`](https://pypi.org/project/langchain-thrindex/) | [`langchain-thrindex`](https://pypi.org/project/langchain-thrindex/) | ❌ | ❌ | ![PyPI - Downloads](https://img.shields.io/pypi/dm/langchain_thrindex?style=flat-square&label=%20) | ![PyPI - Version](https://img.shields.io/pypi/v/langchain_thrindex?style=flat-square&label=%20) | + +## Setup + +To use `ThrindexStore`, create a free account at [thrindex.com](https://thrindex.com) and generate an API key. + +### Installation + +```python +pip install -qU langchain-thrindex +``` + +## Instantiation + +```python +from langchain_thrindex import ThrindexStore + +store = ThrindexStore( + api_key="th_live_...", # your Thrindex API key + agent_id="my-agent", # stable identifier for your agent +) +``` + +## Use with a LangGraph agent + +Pass `store` directly to `graph.compile()`. The agent can then read and write long-term memories that persist across all sessions. + +```python +from langgraph.prebuilt import create_react_agent +from langchain_thrindex import ThrindexStore + +store = ThrindexStore(api_key="th_live_...", agent_id="support-bot") + +agent = create_react_agent( + model="openai:gpt-4o", + tools=[...], + store=store, +) + +result = agent.invoke( + {"messages": [{"role": "user", "content": "My name is Alice and I prefer dark mode."}]}, + config={"configurable": {"thread_id": "thread-1"}}, +) +``` + +On the next session the agent automatically searches Thrindex for relevant memories before responding. + +## Usage + +You can also interact with the store directly. + +### Store a memory + +```python +store.put( + ("memories", "user-42"), # namespace — (category, user_id) + "preference-display", # unique key within the namespace + {"content": "User prefers dark mode and compact layout"}, +) +``` + +### Semantic search + +```python +results = store.search( + ("memories", "user-42"), + query="display preferences", + limit=5, +) + +for item in results: + print(item.value["content"], item.score) +``` + +### Get by key + +```python +item = store.get(("memories", "user-42"), "preference-display") +``` + +### Delete + +```python +store.delete(("memories", "user-42"), "preference-display") +``` + +### Async support + +All operations have async counterparts for use in async frameworks: + +```python +await store.aput(namespace, key, value) +item = await store.aget(namespace, key) +items = await store.asearch(namespace, query="...") +await store.adelete(namespace, key) +``` + +## Namespace mapping + +LangGraph namespaces are tuples of strings, e.g. `("memories", "user-42")`. `ThrindexStore` maps them to Thrindex scopes as follows: + +| LangGraph | Thrindex | +| :--- | :--- | +| `agent_id` constructor arg | `agent_id` on every API call | +| `"/".join(namespace)` | `user_id` on every API call | + +This means every unique namespace is isolated within Thrindex's user scope, enabling per-user and per-agent memory separation. + +--- + +## API reference + +For full configuration options, head to the [langchain-thrindex PyPI page](https://pypi.org/project/langchain-thrindex/) or the [Thrindex documentation](https://docs.thrindex.com). From c76d7aea092a6362fd6b05469a258f30753349af Mon Sep 17 00:00:00 2001 From: Theodoros Nomikos Date: Fri, 29 May 2026 17:46:07 +0300 Subject: [PATCH 2/2] fix: remove em dash spaces to pass Vale lint --- src/oss/python/integrations/stores/thrindex.mdx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/oss/python/integrations/stores/thrindex.mdx b/src/oss/python/integrations/stores/thrindex.mdx index f87dbb034c..90383f0ca0 100644 --- a/src/oss/python/integrations/stores/thrindex.mdx +++ b/src/oss/python/integrations/stores/thrindex.mdx @@ -7,7 +7,7 @@ This guide will help you get started with [Thrindex](https://thrindex.com) as a ## Overview -`ThrindexStore` is a persistent `BaseStore` implementation backed by [Thrindex](https://thrindex.com) — a memory API for AI agents. It stores memories durably and supports native semantic search, so your LangGraph agents can recall relevant facts across sessions without managing embeddings or vector infrastructure. +`ThrindexStore` is a persistent `BaseStore` implementation backed by [Thrindex](https://thrindex.com), a memory API for AI agents. It stores memories durably and supports native semantic search, so your LangGraph agents can recall relevant facts across sessions without managing embeddings or vector infrastructure. Unlike ephemeral stores such as `InMemoryStore`, `ThrindexStore` persists across process restarts and deployments, making it suitable for production agents.