Retrieves a paginated list of memory stores in the workspace. Use cursor-based pagination parameters to navigate through the results.
from orq_ai_sdk import Orq
import os
with Orq(
api_key=os.getenv("ORQ_API_KEY", ""),
) as orq:
res = orq.memory_stores.list(limit=10)
# Handle response
print(res)
| Parameter |
Type |
Required |
Description |
limit |
Optional[int] |
➖ |
A limit on the number of objects to be returned. Limit can range between 1 and 50, and the default is 10 |
starting_after |
Optional[str] |
➖ |
A cursor for use in pagination. starting_after is an object ID that defines your place in the list. For instance, if you make a list request and receive 20 objects, ending with 01JJ1HDHN79XAS7A01WB3HYSDB, your subsequent call can include after=01JJ1HDHN79XAS7A01WB3HYSDB in order to fetch the next page of the list. |
ending_before |
Optional[str] |
➖ |
A cursor for use in pagination. ending_before is an object ID that defines your place in the list. For instance, if you make a list request and receive 20 objects, starting with 01JJ1HDHN79XAS7A01WB3HYSDB, your subsequent call can include before=01JJ1HDHN79XAS7A01WB3HYSDB in order to fetch the previous page of the list. |
search |
Optional[str] |
➖ |
Filter memory stores by key (case-insensitive match) |
updated_by |
Optional[str] |
➖ |
Filter by the users who last updated the memory store. Accepts a comma-separated list of user IDs |
project_id |
Optional[str] |
➖ |
Filter memory stores by project ID |
retries |
Optional[utils.RetryConfig] |
➖ |
Configuration to override the default retry behavior of the client. |
models.ListMemoryStoresResponse
| Error Type |
Status Code |
Content Type |
| models.HonoAPIError |
401 |
application/json |
| models.APIDefaultError |
4XX, 5XX |
*/* |
Create memory store
from orq_ai_sdk import Orq
import os
with Orq(
api_key=os.getenv("ORQ_API_KEY", ""),
) as orq:
res = orq.memory_stores.create(key="<key>", embedding_config={
"model": "cohere/embed-multilingual-light-v3.0",
}, description="unlike excluding soulful quirkily hmph baseboard whereas gee deserted", path="Default")
# Handle response
print(res)
| Parameter |
Type |
Required |
Description |
Example |
key |
str |
✔️ |
The unique key of the memory store. The key is unique and inmmutable and cannot be repeated within the same workspace. |
|
embedding_config |
models.MemoryStoreEmbeddingConfig |
✔️ |
N/A |
|
description |
str |
✔️ |
N/A |
Long-term memory store for customer preferences and interaction history. |
path |
str |
✔️ |
Entity storage path. With workspace-level API keys, the first element identifies the project. With project-level API keys, the path is relative to that project. |
|
ttl |
OptionalNullable[float] |
➖ |
N/A |
|
retries |
Optional[utils.RetryConfig] |
➖ |
Configuration to override the default retry behavior of the client. |
|
models.MemoryStore
| Error Type |
Status Code |
Content Type |
| models.APIDefaultError |
4XX, 5XX |
*/* |
Retrieves detailed information about a specific memory store, including its configuration and metadata.
from orq_ai_sdk import Orq
import os
with Orq(
api_key=os.getenv("ORQ_API_KEY", ""),
) as orq:
res = orq.memory_stores.retrieve(memory_store_key="<value>")
# Handle response
print(res)
| Parameter |
Type |
Required |
Description |
memory_store_key |
str |
✔️ |
N/A |
retries |
Optional[utils.RetryConfig] |
➖ |
Configuration to override the default retry behavior of the client. |
models.MemoryStore
| Error Type |
Status Code |
Content Type |
| models.HonoAPIError |
401, 403, 404 |
application/json |
| models.APIDefaultError |
4XX, 5XX |
*/* |
Permanently delete a memory store, including memories and documents.
from orq_ai_sdk import Orq
import os
with Orq(
api_key=os.getenv("ORQ_API_KEY", ""),
) as orq:
orq.memory_stores.delete(memory_store_key="<value>")
# Use the SDK ...
| Parameter |
Type |
Required |
Description |
memory_store_key |
str |
✔️ |
N/A |
retries |
Optional[utils.RetryConfig] |
➖ |
Configuration to override the default retry behavior of the client. |
| Error Type |
Status Code |
Content Type |
| models.APIDefaultError |
4XX, 5XX |
*/* |
Update the memory store configuration
from orq_ai_sdk import Orq
import os
with Orq(
api_key=os.getenv("ORQ_API_KEY", ""),
) as orq:
res = orq.memory_stores.update(memory_store_key="<value>")
# Handle response
print(res)
| Parameter |
Type |
Required |
Description |
memory_store_key |
str |
✔️ |
N/A |
description |
Optional[str] |
➖ |
N/A |
ttl |
OptionalNullable[float] |
➖ |
N/A |
path |
Optional[str] |
➖ |
N/A |
project_id |
Optional[str] |
➖ |
New containing project. Omit to keep the current project; path resolves inside it. |
retries |
Optional[utils.RetryConfig] |
➖ |
Configuration to override the default retry behavior of the client. |
models.MemoryStore
| Error Type |
Status Code |
Content Type |
| models.APIDefaultError |
4XX, 5XX |
*/* |
Retrieves a paginated list of memories for the memory store
from orq_ai_sdk import Orq
import os
with Orq(
api_key=os.getenv("ORQ_API_KEY", ""),
) as orq:
res = orq.memory_stores.list_memories(memory_store_key="<value>", limit=10)
# Handle response
print(res)
| Parameter |
Type |
Required |
Description |
memory_store_key |
str |
✔️ |
The unique key identifier of the memory store |
limit |
Optional[int] |
➖ |
A limit on the number of objects to be returned. Limit can range between 1 and 50, and the default is 10 |
starting_after |
Optional[str] |
➖ |
A cursor for use in pagination. starting_after is an object ID that defines your place in the list. For instance, if you make a list request and receive 20 objects, ending with 01JJ1HDHN79XAS7A01WB3HYSDB, your subsequent call can include after=01JJ1HDHN79XAS7A01WB3HYSDB in order to fetch the next page of the list. |
ending_before |
Optional[str] |
➖ |
A cursor for use in pagination. ending_before is an object ID that defines your place in the list. For instance, if you make a list request and receive 20 objects, starting with 01JJ1HDHN79XAS7A01WB3HYSDB, your subsequent call can include before=01JJ1HDHN79XAS7A01WB3HYSDB in order to fetch the previous page of the list. |
q |
Optional[str] |
➖ |
Search query to filter memories by entity_id |
retries |
Optional[utils.RetryConfig] |
➖ |
Configuration to override the default retry behavior of the client. |
models.ListMemoriesResponse
| Error Type |
Status Code |
Content Type |
| models.APIDefaultError |
4XX, 5XX |
*/* |
Creates a new memory in the specified memory store.
from orq_ai_sdk import Orq
import os
with Orq(
api_key=os.getenv("ORQ_API_KEY", ""),
) as orq:
res = orq.memory_stores.create_memory(memory_store_key="<value>", entity_id="<id>")
# Handle response
print(res)
| Parameter |
Type |
Required |
Description |
memory_store_key |
str |
✔️ |
N/A |
entity_id |
str |
✔️ |
Unique identifier for the entity this memory is associated with (e.g., user ID, session ID, conversation ID). |
retries |
Optional[utils.RetryConfig] |
➖ |
Configuration to override the default retry behavior of the client. |
models.Memory
| Error Type |
Status Code |
Content Type |
| models.APIDefaultError |
4XX, 5XX |
*/* |
Retrieves details of a specific memory by its ID
from orq_ai_sdk import Orq
import os
with Orq(
api_key=os.getenv("ORQ_API_KEY", ""),
) as orq:
res = orq.memory_stores.retrieve_memory(memory_store_key="<value>", memory_entity_id="<id>")
# Handle response
print(res)
| Parameter |
Type |
Required |
Description |
memory_store_key |
str |
✔️ |
N/A |
memory_entity_id |
str |
✔️ |
N/A |
retries |
Optional[utils.RetryConfig] |
➖ |
Configuration to override the default retry behavior of the client. |
models.Memory
| Error Type |
Status Code |
Content Type |
| models.APIDefaultError |
4XX, 5XX |
*/* |
Permanently deletes a specific memory.
Use this endpoint to:
- Remove a memory from the store
- Clean up unused memories
- Manage memory storage space
from orq_ai_sdk import Orq
import os
with Orq(
api_key=os.getenv("ORQ_API_KEY", ""),
) as orq:
orq.memory_stores.delete_memory(memory_store_key="<value>", memory_entity_id="<id>")
# Use the SDK ...
| Parameter |
Type |
Required |
Description |
memory_store_key |
str |
✔️ |
N/A |
memory_entity_id |
str |
✔️ |
N/A |
retries |
Optional[utils.RetryConfig] |
➖ |
Configuration to override the default retry behavior of the client. |
| Error Type |
Status Code |
Content Type |
| models.APIDefaultError |
4XX, 5XX |
*/* |
Updates the details of a specific memory.
from orq_ai_sdk import Orq
import os
with Orq(
api_key=os.getenv("ORQ_API_KEY", ""),
) as orq:
res = orq.memory_stores.update_memory(memory_store_key="<value>", memory_entity_id="<id>")
# Handle response
print(res)
| Parameter |
Type |
Required |
Description |
memory_store_key |
str |
✔️ |
N/A |
memory_entity_id |
str |
✔️ |
N/A |
metadata |
Dict[str, str] |
➖ |
N/A |
retries |
Optional[utils.RetryConfig] |
➖ |
Configuration to override the default retry behavior of the client. |
models.Memory
| Error Type |
Status Code |
Content Type |
| models.APIDefaultError |
4XX, 5XX |
*/* |
Retrieves a paginated list of documents associated with a specific memory.
from orq_ai_sdk import Orq
import os
with Orq(
api_key=os.getenv("ORQ_API_KEY", ""),
) as orq:
res = orq.memory_stores.list_documents(memory_store_key="<value>", memory_entity_id="<id>", limit=10)
# Handle response
print(res)
| Parameter |
Type |
Required |
Description |
memory_store_key |
str |
✔️ |
The unique key identifier of the memory store |
memory_entity_id |
str |
✔️ |
The unique identifier of the memory |
limit |
Optional[int] |
➖ |
A limit on the number of objects to be returned. Limit can range between 1 and 50, and the default is 10 |
starting_after |
Optional[str] |
➖ |
A cursor for use in pagination. starting_after is an object ID that defines your place in the list. For instance, if you make a list request and receive 20 objects, ending with 01JJ1HDHN79XAS7A01WB3HYSDB, your subsequent call can include after=01JJ1HDHN79XAS7A01WB3HYSDB in order to fetch the next page of the list. |
ending_before |
Optional[str] |
➖ |
A cursor for use in pagination. ending_before is an object ID that defines your place in the list. For instance, if you make a list request and receive 20 objects, starting with 01JJ1HDHN79XAS7A01WB3HYSDB, your subsequent call can include before=01JJ1HDHN79XAS7A01WB3HYSDB in order to fetch the previous page of the list. |
updated_after |
date |
➖ |
Filter documents updated after this ISO datetime |
updated_before |
date |
➖ |
Filter documents updated before this ISO datetime |
retries |
Optional[utils.RetryConfig] |
➖ |
Configuration to override the default retry behavior of the client. |
models.ListMemoryDocumentsResponse
| Error Type |
Status Code |
Content Type |
| models.APIDefaultError |
4XX, 5XX |
*/* |
Creates a new document in the specified memory.
from orq_ai_sdk import Orq
import os
with Orq(
api_key=os.getenv("ORQ_API_KEY", ""),
) as orq:
res = orq.memory_stores.create_document(memory_store_key="<value>", memory_entity_id="<id>", text="<value>")
# Handle response
print(res)
| Parameter |
Type |
Required |
Description |
memory_store_key |
str |
✔️ |
N/A |
memory_entity_id |
str |
✔️ |
N/A |
text |
str |
✔️ |
The content of the memory document (whitespace trimmed). |
metadata |
Dict[str, str] |
➖ |
Flexible key-value pairs for custom filtering and categorization. Clients can add arbitrary string metadata to enable future filtering of memory documents based on their specific needs. |
retries |
Optional[utils.RetryConfig] |
➖ |
Configuration to override the default retry behavior of the client. |
models.MemoryDocument
| Error Type |
Status Code |
Content Type |
| models.APIDefaultError |
4XX, 5XX |
*/* |
Retrieves details of a specific memory document by its ID.
from orq_ai_sdk import Orq
import os
with Orq(
api_key=os.getenv("ORQ_API_KEY", ""),
) as orq:
res = orq.memory_stores.retrieve_document(memory_store_key="<value>", memory_entity_id="<id>", document_id="<id>")
# Handle response
print(res)
| Parameter |
Type |
Required |
Description |
memory_store_key |
str |
✔️ |
N/A |
memory_entity_id |
str |
✔️ |
N/A |
document_id |
str |
✔️ |
N/A |
retries |
Optional[utils.RetryConfig] |
➖ |
Configuration to override the default retry behavior of the client. |
models.MemoryDocument
| Error Type |
Status Code |
Content Type |
| models.APIDefaultError |
4XX, 5XX |
*/* |
Permanently deletes a specific memory document.
Use this endpoint to:
- Remove a document from a memory
- Clean up unused documents
- Manage document storage space
from orq_ai_sdk import Orq
import os
with Orq(
api_key=os.getenv("ORQ_API_KEY", ""),
) as orq:
orq.memory_stores.delete_document(memory_store_key="<value>", memory_entity_id="<id>", document_id="<id>")
# Use the SDK ...
| Parameter |
Type |
Required |
Description |
memory_store_key |
str |
✔️ |
N/A |
memory_entity_id |
str |
✔️ |
N/A |
document_id |
str |
✔️ |
N/A |
retries |
Optional[utils.RetryConfig] |
➖ |
Configuration to override the default retry behavior of the client. |
| Error Type |
Status Code |
Content Type |
| models.APIDefaultError |
4XX, 5XX |
*/* |
Updates the details of a specific memory document.
from orq_ai_sdk import Orq
import os
with Orq(
api_key=os.getenv("ORQ_API_KEY", ""),
) as orq:
res = orq.memory_stores.update_document(memory_store_key="<value>", memory_entity_id="<id>", document_id="<id>")
# Handle response
print(res)
| Parameter |
Type |
Required |
Description |
memory_store_key |
str |
✔️ |
N/A |
memory_entity_id |
str |
✔️ |
N/A |
document_id |
str |
✔️ |
N/A |
text |
Optional[str] |
➖ |
The content of the memory document (whitespace trimmed). |
metadata |
Dict[str, str] |
➖ |
Flexible key-value pairs for custom filtering and categorization. Clients can add arbitrary string metadata to enable future filtering of memory documents based on their specific needs. |
retries |
Optional[utils.RetryConfig] |
➖ |
Configuration to override the default retry behavior of the client. |
models.MemoryDocument
| Error Type |
Status Code |
Content Type |
| models.APIDefaultError |
4XX, 5XX |
*/* |