Skip to main content
This guide explains how to add semantic search to your deployment’s cross-thread store, so that your agent can search for memories and other documents by semantic similarity.

Prerequisites

Steps

  1. Update your langgraph.json configuration file to include the store configuration:
This configuration:
  • Uses OpenAI’s text-embedding-3-small model for generating embeddings
  • Sets the embedding dimension to 1536 (matching the model’s output)
  • Indexes all fields in your stored data (["$"] means index everything, or specify specific fields like ["text", "metadata.title"])
  1. To use the string embedding format above, make sure your dependencies include langchain >= 0.3.8:
Or if using requirements.txt:

Usage

Once configured, you can use semantic search in your nodes. The store requires a namespace tuple to organize memories:

Custom Embeddings

If you want to use custom embeddings, you can pass a path to a custom embedding function:
The deployment will look for the function in the specified path. The function must be async and accept a list of strings:

Querying via the API

You can also query the store using the LangGraph SDK. Since the SDK uses async operations:

Connect these docs programmatically to Claude, VSCode, and more via MCP for real-time answers.