Skip to content
Merged
Changes from 1 commit
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 or `scope` 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"
}
}
```