Skip to main content

MemoryStores

List MemoryStores

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)

Create a MemoryStore

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(request={
        "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)

Retrieve a MemoryStore

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)

Update a MemoryStore

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>", description="wherever cash since now exempt proliferate aha tabulate ack", path="Default")

    # Handle response
    print(res)

Delete a MemoryStore

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 ...

List Memories

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)

Create Memory

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)

Retrieve Memory

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)

Update Memory

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)

Delete Memory

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 ...

List Documents

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)

Create Document

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)

Retrieve Document

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)

Update Document

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)

Delete Document

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 ...