Skip to main content
We explain how to integrate Ceramic Search with LangChain to build RAG pipelines and ground agent responses in high-quality web search results.

Installation

API keys

Get your Ceramic API key and set it as an environment variable:

Get API Key

Create a Ceramic account for free to get an API key.
Also set up any additional API keys you need, e.g., OpenAI via

Example usage

Tool calling

LangChain agents can use Ceramic search via tool calling to support their response with sources from the web. Ceramic uses lexical (keyword-based) search. See Best Practices for information on how to use Ceramic Search most effectively. When calling Ceramic search via a tool call, the LLM automatically converts the natural language query into an optimized keyword-based query for search.

RAG pipeline

Use the retriever tool CeramicSearchRetriever to obtain relevant documents for RAG pipelines. Because Ceramic uses lexical search, we first convert the natural language query into keywords using an LLM before retrieval. The original natural language query is still passed through to the answer prompt.
Each retrieved Document has:
  • page_content: the result description
  • metadata["title"]: page title
  • metadata["url"]: source URL

Async usage

Both CeramicSearchRetriever and CeramicSearch support async:

Parameters

CeramicSearch

CeramicSearchRetriever

GitHub

View source code

PyPI

View package