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.
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 toolCeramicSearchRetriever 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.
Document has:
page_content: the result descriptionmetadata["title"]: page titlemetadata["url"]: source URL
Async usage
BothCeramicSearchRetriever and CeramicSearch support async:
Parameters
CeramicSearch
| Parameter | Type | Description | Default |
|---|---|---|---|
api_key | str | None | Ceramic API key (falls back to CERAMIC_API_KEY env var) | None |
max_results | int | Maximum number of results to include in the response string | 5 |
CeramicSearchRetriever
| Parameter | Type | Description | Default |
|---|---|---|---|
api_key | str | None | Ceramic API key (falls back to CERAMIC_API_KEY env var) | None |
k | int | Maximum number of results to return | 10 |
GitHub
View source code
PyPI
View package

