Skip to content

Update use-langcache.md #1710

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Jun 16, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 2 additions & 17 deletions content/operate/rc/langcache/use-langcache.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ title: Use the LangCache API with your GenAI app
weight: 10
---

You can use the LangCache API from your client app to store and retrieve LLM responses.
You can use the LangCache API from your client app to store and retrieve LLM, RAG, or agent responses.

To access the LangCache API, you need:

Expand Down Expand Up @@ -64,19 +64,14 @@ Place this call in your client app right before you call your LLM's REST API. If

If LangCache does not return a response, you should call your LLM's REST API to generate a new response. After you get a response from the LLM, you can [store it in LangCache](#store-a-new-response-in-langcache) for future use.

You can also limit the responses returned from LangCache by adding an `attributes` object or `scope` object to the request. LangCache will only return responses that match the attributes you specify.
You can also scope the responses returned from LangCache by adding an `attributes` object to the request. LangCache will only return responses that match the attributes you specify.

```sh
POST https://[host]/v1/caches/{cacheId}/search
{
"prompt": "User prompt text",
"attributes": {
"customAttributeName": "customAttributeValue"
},
"scope": {
"applicationId": "applicationId",
"userId": "userId",
"sessionId": "sessionId"
}
}
```
Expand Down Expand Up @@ -104,11 +99,6 @@ POST https://[host]/v1/caches/{cacheId}/entries
"response": "LLM response text",
"attributes": {
"customAttributeName": "customAttributeValue"
},
"scope": {
"applicationId": "applicationId",
"userId": "userId",
"sessionId": "sessionId"
}
}
```
Expand All @@ -124,11 +114,6 @@ DELETE https://[host]/v1/caches/{cacheId}/entries
{
"attributes": {
"customAttributeName": "customAttributeValue"
},
"scope": {
"applicationId": "applicationId",
"userId": "userId",
"sessionId": "sessionId"
}
}
```