> ## Documentation Index
> Fetch the complete documentation index at: https://docs.orq.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# MemoryStores SDK Reference

> SDK reference for the MemoryStores API, available in Node.js and Python.

## MemoryStores

### List MemoryStores

Retrieves a paginated list of memory stores in the workspace. Use cursor-based pagination parameters to navigate through the results.

<CodeGroup>
  ```python Python theme={"theme":{"light":"github-light","dark":"github-dark"}}
  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)

  ```

  ```typescript Node.js theme={"theme":{"light":"github-light","dark":"github-dark"}}
  import { Orq } from "@orq-ai/node";

  const orq = new Orq({
    apiKey: process.env["ORQ_API_KEY"] ?? "",
  });

  async function run() {
    const result = await orq.memoryStores.list({});

    console.log(result);
  }

  run();
  ```
</CodeGroup>

<Expandable title="Parameters">
  <CodeGroup>
    ```python Python theme={"theme":{"light":"github-light","dark":"github-dark"}}
    {
        "limit": Optional[int],
        "starting_after": Optional[str],
        "ending_before": Optional[str],
        "search": Optional[str],
        "updated_by": Optional[str],
        "project_id": Optional[str],
    }
    ```

    ```typescript Node.js theme={"theme":{"light":"github-light","dark":"github-dark"}}
    {
      limit?: number;
      startingAfter?: string;
      endingBefore?: string;
      search?: string;
      updatedBy?: string;
      projectId?: string;
    }
    ```
  </CodeGroup>
</Expandable>

<Expandable title="Response">
  <CodeGroup>
    ```python Python theme={"theme":{"light":"github-light","dark":"github-dark"}}
    {
        "object": Literal["list"],
        "data": {
            "id": str,
            "key": str,
            "description": str,
            "created_by_id": OptionalNullable[str],
            "updated_by_id": OptionalNullable[str],
            "created": str,
            "updated": str,
            "ttl": OptionalNullable[float],
            "embedding_config": {
                "model": str,
            },
        },
        "has_more": bool,
    }
    ```

    ```typescript Node.js theme={"theme":{"light":"github-light","dark":"github-dark"}}
    {
      object: string;
      data: {
        id: string;
        key: string;
        description: string;
        createdById?: string;
        updatedById?: string;
        created: string;
        updated: string;
        ttl?: number;
        embeddingConfig: {
          model: string;
        };
      };
      hasMore: boolean;
    }
    ```
  </CodeGroup>
</Expandable>

### Create a MemoryStore

Create memory store

<CodeGroup>
  ```python Python theme={"theme":{"light":"github-light","dark":"github-dark"}}
  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)

  ```

  ```typescript Node.js theme={"theme":{"light":"github-light","dark":"github-dark"}}
  import { Orq } from "@orq-ai/node";

  const orq = new Orq({
    apiKey: process.env["ORQ_API_KEY"] ?? "",
  });

  async function run() {
    const result = await orq.memoryStores.create({
      key: "<key>",
      embeddingConfig: {
        model: "cohere/embed-multilingual-light-v3.0",
      },
      description: "unlike excluding soulful quirkily hmph baseboard whereas gee deserted",
      path: "Default",
    });

    console.log(result);
  }

  run();
  ```
</CodeGroup>

<Expandable title="Parameters">
  <CodeGroup>
    ```python Python theme={"theme":{"light":"github-light","dark":"github-dark"}}
    {
        "key": str,  # required
        "embedding_config": {  # required
            "model": str,  # required
        },
        "description": str,  # required
        "ttl": OptionalNullable[float],
        "path": str,  # required
    }
    ```

    ```typescript Node.js theme={"theme":{"light":"github-light","dark":"github-dark"}}
    {
      key: string;  // required
      embeddingConfig: {  // required
        model: string;  // required
      };
      description: string;  // required
      ttl?: number;
      path: string;  // required
    }
    ```
  </CodeGroup>
</Expandable>

<Expandable title="Response">
  <CodeGroup>
    ```python Python theme={"theme":{"light":"github-light","dark":"github-dark"}}
    {
        "id": str,
        "key": str,
        "description": str,
        "created_by_id": OptionalNullable[str],
        "updated_by_id": OptionalNullable[str],
        "created": str,
        "updated": str,
        "ttl": OptionalNullable[float],
        "embedding_config": {
            "model": str,
        },
    }
    ```

    ```typescript Node.js theme={"theme":{"light":"github-light","dark":"github-dark"}}
    {
      id: string;
      key: string;
      description: string;
      createdById?: string;
      updatedById?: string;
      created: string;
      updated: string;
      ttl?: number;
      embeddingConfig: {
        model: string;
      };
    }
    ```
  </CodeGroup>
</Expandable>

### Retrieve a MemoryStore

Retrieves detailed information about a specific memory store, including its configuration and metadata.

<CodeGroup>
  ```python Python theme={"theme":{"light":"github-light","dark":"github-dark"}}
  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)

  ```

  ```typescript Node.js theme={"theme":{"light":"github-light","dark":"github-dark"}}
  import { Orq } from "@orq-ai/node";

  const orq = new Orq({
    apiKey: process.env["ORQ_API_KEY"] ?? "",
  });

  async function run() {
    const result = await orq.memoryStores.retrieve({
      memoryStoreKey: "<value>",
    });

    console.log(result);
  }

  run();
  ```
</CodeGroup>

<Expandable title="Parameters">
  <CodeGroup>
    ```python Python theme={"theme":{"light":"github-light","dark":"github-dark"}}
    {
        "memory_store_key": str,  # required
    }
    ```

    ```typescript Node.js theme={"theme":{"light":"github-light","dark":"github-dark"}}
    {
      memoryStoreKey: string;  // required
    }
    ```
  </CodeGroup>
</Expandable>

<Expandable title="Response">
  <CodeGroup>
    ```python Python theme={"theme":{"light":"github-light","dark":"github-dark"}}
    {
        "id": str,
        "key": str,
        "description": str,
        "created_by_id": OptionalNullable[str],
        "updated_by_id": OptionalNullable[str],
        "created": str,
        "updated": str,
        "ttl": OptionalNullable[float],
        "embedding_config": {
            "model": str,
        },
    }
    ```

    ```typescript Node.js theme={"theme":{"light":"github-light","dark":"github-dark"}}
    {
      id: string;
      key: string;
      description: string;
      createdById?: string;
      updatedById?: string;
      created: string;
      updated: string;
      ttl?: number;
      embeddingConfig: {
        model: string;
      };
    }
    ```
  </CodeGroup>
</Expandable>

### Update a MemoryStore

Update the memory store configuration

<CodeGroup>
  ```python Python theme={"theme":{"light":"github-light","dark":"github-dark"}}
  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)

  ```

  ```typescript Node.js theme={"theme":{"light":"github-light","dark":"github-dark"}}
  import { Orq } from "@orq-ai/node";

  const orq = new Orq({
    apiKey: process.env["ORQ_API_KEY"] ?? "",
  });

  async function run() {
    const result = await orq.memoryStores.update({
      memoryStoreKey: "<value>",
      requestBody: {
        description: "wherever cash since now exempt proliferate aha tabulate ack",
        path: "Default",
      },
    });

    console.log(result);
  }

  run();
  ```
</CodeGroup>

<Expandable title="Parameters">
  <CodeGroup>
    ```python Python theme={"theme":{"light":"github-light","dark":"github-dark"}}
    {
        "memory_store_key": str,  # required
        "description": Optional[str],
        "ttl": OptionalNullable[float],
        "path": Optional[str],
    }
    ```

    ```typescript Node.js theme={"theme":{"light":"github-light","dark":"github-dark"}}
    {
      memoryStoreKey: string;  // required
      requestBody?: {
        description?: string;
        ttl?: number;
        path?: string;
      };
    }
    ```
  </CodeGroup>
</Expandable>

<Expandable title="Response">
  <CodeGroup>
    ```python Python theme={"theme":{"light":"github-light","dark":"github-dark"}}
    {
        "id": str,
        "key": str,
        "description": str,
        "created_by_id": OptionalNullable[str],
        "updated_by_id": OptionalNullable[str],
        "created": str,
        "updated": str,
        "ttl": OptionalNullable[float],
        "embedding_config": {
            "model": str,
        },
    }
    ```

    ```typescript Node.js theme={"theme":{"light":"github-light","dark":"github-dark"}}
    {
      id: string;
      key: string;
      description: string;
      createdById?: string;
      updatedById?: string;
      created: string;
      updated: string;
      ttl?: number;
      embeddingConfig: {
        model: string;
      };
    }
    ```
  </CodeGroup>
</Expandable>

### Delete a MemoryStore

Permanently delete a memory store, including memories and documents.

<CodeGroup>
  ```python Python theme={"theme":{"light":"github-light","dark":"github-dark"}}
  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 ...

  ```

  ```typescript Node.js theme={"theme":{"light":"github-light","dark":"github-dark"}}
  import { Orq } from "@orq-ai/node";

  const orq = new Orq({
    apiKey: process.env["ORQ_API_KEY"] ?? "",
  });

  async function run() {
    await orq.memoryStores.delete({
      memoryStoreKey: "<value>",
    });

  }

  run();
  ```
</CodeGroup>

<Expandable title="Parameters">
  <CodeGroup>
    ```python Python theme={"theme":{"light":"github-light","dark":"github-dark"}}
    {
        "memory_store_key": str,  # required
    }
    ```

    ```typescript Node.js theme={"theme":{"light":"github-light","dark":"github-dark"}}
    {
      memoryStoreKey: string;  // required
    }
    ```
  </CodeGroup>
</Expandable>

### List Memories

Retrieves a paginated list of memories for the memory store

<CodeGroup>
  ```python Python theme={"theme":{"light":"github-light","dark":"github-dark"}}
  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)

  ```

  ```typescript Node.js theme={"theme":{"light":"github-light","dark":"github-dark"}}
  import { Orq } from "@orq-ai/node";

  const orq = new Orq({
    apiKey: process.env["ORQ_API_KEY"] ?? "",
  });

  async function run() {
    const result = await orq.memoryStores.listMemories({
      memoryStoreKey: "<value>",
    });

    console.log(result);
  }

  run();
  ```
</CodeGroup>

<Expandable title="Parameters">
  <CodeGroup>
    ```python Python theme={"theme":{"light":"github-light","dark":"github-dark"}}
    {
        "memory_store_key": str,  # required
        "limit": Optional[int],
        "starting_after": Optional[str],
        "ending_before": Optional[str],
        "q": Optional[str],
    }
    ```

    ```typescript Node.js theme={"theme":{"light":"github-light","dark":"github-dark"}}
    {
      memoryStoreKey: string;  // required
      limit?: number;
      startingAfter?: string;
      endingBefore?: string;
      q?: string;
    }
    ```
  </CodeGroup>
</Expandable>

<Expandable title="Response">
  <CodeGroup>
    ```python Python theme={"theme":{"light":"github-light","dark":"github-dark"}}
    {
        "object": Literal["list"],
        "data": {
            "id": str,
            "~~`entity_id`~~": str,
            "created": str,
            "updated": str,
            "created_by_id": OptionalNullable[str],
            "updated_by_id": OptionalNullable[str],
            "store_id": str,
            "workspace_id": str,
            "documents_count": float,
        },
        "has_more": bool,
    }
    ```

    ```typescript Node.js theme={"theme":{"light":"github-light","dark":"github-dark"}}
    {
      object: string;
      data: {
        id: string;
        ~~`entityId`~~: string;
        created: string;
        updated: string;
        createdById?: string;
        updatedById?: string;
        storeId: string;
        workspaceId: string;
        documentsCount: number;
      };
      hasMore: boolean;
    }
    ```
  </CodeGroup>
</Expandable>

### Create Memory

Creates a new memory in the specified memory store.

<CodeGroup>
  ```python Python theme={"theme":{"light":"github-light","dark":"github-dark"}}
  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)

  ```

  ```typescript Node.js theme={"theme":{"light":"github-light","dark":"github-dark"}}
  import { Orq } from "@orq-ai/node";

  const orq = new Orq({
    apiKey: process.env["ORQ_API_KEY"] ?? "",
  });

  async function run() {
    const result = await orq.memoryStores.createMemory({
      memoryStoreKey: "<value>",
    });

    console.log(result);
  }

  run();
  ```
</CodeGroup>

<Expandable title="Parameters">
  <CodeGroup>
    ```python Python theme={"theme":{"light":"github-light","dark":"github-dark"}}
    {
        "memory_store_key": str,  # required
        "entity_id": str,  # required
    }
    ```

    ```typescript Node.js theme={"theme":{"light":"github-light","dark":"github-dark"}}
    {
      memoryStoreKey: string;  // required
      requestBody?: {
        entityId: string;  // required
      };
    }
    ```
  </CodeGroup>
</Expandable>

<Expandable title="Response">
  <CodeGroup>
    ```python Python theme={"theme":{"light":"github-light","dark":"github-dark"}}
    {
        "id": str,
        "~~`entity_id`~~": str,
        "created": str,
        "updated": str,
        "created_by_id": OptionalNullable[str],
        "updated_by_id": OptionalNullable[str],
        "store_id": str,
        "workspace_id": str,
        "documents_count": float,
    }
    ```

    ```typescript Node.js theme={"theme":{"light":"github-light","dark":"github-dark"}}
    {
      id: string;
      ~~`entityId`~~: string;
      created: string;
      updated: string;
      createdById?: string;
      updatedById?: string;
      storeId: string;
      workspaceId: string;
      documentsCount: number;
    }
    ```
  </CodeGroup>
</Expandable>

### Retrieve Memory

Retrieves details of a specific memory by its ID

<CodeGroup>
  ```python Python theme={"theme":{"light":"github-light","dark":"github-dark"}}
  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)

  ```

  ```typescript Node.js theme={"theme":{"light":"github-light","dark":"github-dark"}}
  import { Orq } from "@orq-ai/node";

  const orq = new Orq({
    apiKey: process.env["ORQ_API_KEY"] ?? "",
  });

  async function run() {
    const result = await orq.memoryStores.retrieveMemory({
      memoryStoreKey: "<value>",
      memoryEntityId: "<id>",
    });

    console.log(result);
  }

  run();
  ```
</CodeGroup>

<Expandable title="Parameters">
  <CodeGroup>
    ```python Python theme={"theme":{"light":"github-light","dark":"github-dark"}}
    {
        "memory_store_key": str,  # required
        "memory_entity_id": str,  # required
    }
    ```

    ```typescript Node.js theme={"theme":{"light":"github-light","dark":"github-dark"}}
    {
      memoryStoreKey: string;  // required
      memoryEntityId: string;  // required
    }
    ```
  </CodeGroup>
</Expandable>

<Expandable title="Response">
  <CodeGroup>
    ```python Python theme={"theme":{"light":"github-light","dark":"github-dark"}}
    {
        "id": str,
        "~~`entity_id`~~": str,
        "created": str,
        "updated": str,
        "created_by_id": OptionalNullable[str],
        "updated_by_id": OptionalNullable[str],
        "store_id": str,
        "workspace_id": str,
        "documents_count": float,
    }
    ```

    ```typescript Node.js theme={"theme":{"light":"github-light","dark":"github-dark"}}
    {
      id: string;
      ~~`entityId`~~: string;
      created: string;
      updated: string;
      createdById?: string;
      updatedById?: string;
      storeId: string;
      workspaceId: string;
      documentsCount: number;
    }
    ```
  </CodeGroup>
</Expandable>

### Update Memory

Updates the details of a specific memory.

<CodeGroup>
  ```python Python theme={"theme":{"light":"github-light","dark":"github-dark"}}
  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)

  ```

  ```typescript Node.js theme={"theme":{"light":"github-light","dark":"github-dark"}}
  import { Orq } from "@orq-ai/node";

  const orq = new Orq({
    apiKey: process.env["ORQ_API_KEY"] ?? "",
  });

  async function run() {
    const result = await orq.memoryStores.updateMemory({
      memoryStoreKey: "<value>",
      memoryEntityId: "<id>",
    });

    console.log(result);
  }

  run();
  ```
</CodeGroup>

<Expandable title="Parameters">
  <CodeGroup>
    ```python Python theme={"theme":{"light":"github-light","dark":"github-dark"}}
    {
        "memory_store_key": str,  # required
        "memory_entity_id": str,  # required
        "metadata": Dict[str, str],
    }
    ```

    ```typescript Node.js theme={"theme":{"light":"github-light","dark":"github-dark"}}
    {
      memoryStoreKey: string;  // required
      memoryEntityId: string;  // required
      requestBody?: {
        metadata?: Record<string, string>;
      };
    }
    ```
  </CodeGroup>
</Expandable>

<Expandable title="Response">
  <CodeGroup>
    ```python Python theme={"theme":{"light":"github-light","dark":"github-dark"}}
    {
        "id": str,
        "~~`entity_id`~~": str,
        "created": str,
        "updated": str,
        "created_by_id": OptionalNullable[str],
        "updated_by_id": OptionalNullable[str],
        "store_id": str,
        "workspace_id": str,
        "documents_count": float,
    }
    ```

    ```typescript Node.js theme={"theme":{"light":"github-light","dark":"github-dark"}}
    {
      id: string;
      ~~`entityId`~~: string;
      created: string;
      updated: string;
      createdById?: string;
      updatedById?: string;
      storeId: string;
      workspaceId: string;
      documentsCount: number;
    }
    ```
  </CodeGroup>
</Expandable>

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

<CodeGroup>
  ```python Python theme={"theme":{"light":"github-light","dark":"github-dark"}}
  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 ...

  ```

  ```typescript Node.js theme={"theme":{"light":"github-light","dark":"github-dark"}}
  import { Orq } from "@orq-ai/node";

  const orq = new Orq({
    apiKey: process.env["ORQ_API_KEY"] ?? "",
  });

  async function run() {
    await orq.memoryStores.deleteMemory({
      memoryStoreKey: "<value>",
      memoryEntityId: "<id>",
    });

  }

  run();
  ```
</CodeGroup>

<Expandable title="Parameters">
  <CodeGroup>
    ```python Python theme={"theme":{"light":"github-light","dark":"github-dark"}}
    {
        "memory_store_key": str,  # required
        "memory_entity_id": str,  # required
    }
    ```

    ```typescript Node.js theme={"theme":{"light":"github-light","dark":"github-dark"}}
    {
      memoryStoreKey: string;  // required
      memoryEntityId: string;  // required
    }
    ```
  </CodeGroup>
</Expandable>

### List Documents

Retrieves a paginated list of documents associated with a specific memory.

<CodeGroup>
  ```python Python theme={"theme":{"light":"github-light","dark":"github-dark"}}
  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)

  ```

  ```typescript Node.js theme={"theme":{"light":"github-light","dark":"github-dark"}}
  import { Orq } from "@orq-ai/node";

  const orq = new Orq({
    apiKey: process.env["ORQ_API_KEY"] ?? "",
  });

  async function run() {
    const result = await orq.memoryStores.listDocuments({
      memoryStoreKey: "<value>",
      memoryEntityId: "<id>",
    });

    console.log(result);
  }

  run();
  ```
</CodeGroup>

<Expandable title="Parameters">
  <CodeGroup>
    ```python Python theme={"theme":{"light":"github-light","dark":"github-dark"}}
    {
        "memory_store_key": str,  # required
        "memory_entity_id": str,  # required
        "limit": Optional[int],
        "starting_after": Optional[str],
        "ending_before": Optional[str],
        "updated_after": date,
        "updated_before": date,
    }
    ```

    ```typescript Node.js theme={"theme":{"light":"github-light","dark":"github-dark"}}
    {
      memoryStoreKey: string;  // required
      memoryEntityId: string;  // required
      limit?: number;
      startingAfter?: string;
      endingBefore?: string;
      updatedAfter?: Date;
      updatedBefore?: Date;
    }
    ```
  </CodeGroup>
</Expandable>

<Expandable title="Response">
  <CodeGroup>
    ```python Python theme={"theme":{"light":"github-light","dark":"github-dark"}}
    {
        "object": Literal["list"],
        "data": {
            "id": str,
            "memory_id": str,
            "store_id": str,
            "text": str,
            "created": str,
            "updated": str,
            "created_by_id": OptionalNullable[str],
            "updated_by_id": OptionalNullable[str],
            "workspace_id": str,
            "metadata": Dict[str, str],
        },
        "has_more": bool,
    }
    ```

    ```typescript Node.js theme={"theme":{"light":"github-light","dark":"github-dark"}}
    {
      object: string;
      data: {
        id: string;
        memoryId: string;
        storeId: string;
        text: string;
        created: string;
        updated: string;
        createdById?: string;
        updatedById?: string;
        workspaceId: string;
        metadata?: Record<string, string>;
      };
      hasMore: boolean;
    }
    ```
  </CodeGroup>
</Expandable>

### Create Document

Creates a new document in the specified memory.

<CodeGroup>
  ```python Python theme={"theme":{"light":"github-light","dark":"github-dark"}}
  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)

  ```

  ```typescript Node.js theme={"theme":{"light":"github-light","dark":"github-dark"}}
  import { Orq } from "@orq-ai/node";

  const orq = new Orq({
    apiKey: process.env["ORQ_API_KEY"] ?? "",
  });

  async function run() {
    const result = await orq.memoryStores.createDocument({
      memoryStoreKey: "<value>",
      memoryEntityId: "<id>",
    });

    console.log(result);
  }

  run();
  ```
</CodeGroup>

<Expandable title="Parameters">
  <CodeGroup>
    ```python Python theme={"theme":{"light":"github-light","dark":"github-dark"}}
    {
        "memory_store_key": str,  # required
        "memory_entity_id": str,  # required
        "text": str,  # required
        "metadata": Dict[str, str],
    }
    ```

    ```typescript Node.js theme={"theme":{"light":"github-light","dark":"github-dark"}}
    {
      memoryStoreKey: string;  // required
      memoryEntityId: string;  // required
      requestBody?: {
        text: string;  // required
        metadata?: Record<string, string>;
      };
    }
    ```
  </CodeGroup>
</Expandable>

<Expandable title="Response">
  <CodeGroup>
    ```python Python theme={"theme":{"light":"github-light","dark":"github-dark"}}
    {
        "id": str,
        "memory_id": str,
        "store_id": str,
        "text": str,
        "created": str,
        "updated": str,
        "created_by_id": OptionalNullable[str],
        "updated_by_id": OptionalNullable[str],
        "workspace_id": str,
        "metadata": Dict[str, str],
    }
    ```

    ```typescript Node.js theme={"theme":{"light":"github-light","dark":"github-dark"}}
    {
      id: string;
      memoryId: string;
      storeId: string;
      text: string;
      created: string;
      updated: string;
      createdById?: string;
      updatedById?: string;
      workspaceId: string;
      metadata?: Record<string, string>;
    }
    ```
  </CodeGroup>
</Expandable>

### Retrieve Document

Retrieves details of a specific memory document by its ID.

<CodeGroup>
  ```python Python theme={"theme":{"light":"github-light","dark":"github-dark"}}
  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)

  ```

  ```typescript Node.js theme={"theme":{"light":"github-light","dark":"github-dark"}}
  import { Orq } from "@orq-ai/node";

  const orq = new Orq({
    apiKey: process.env["ORQ_API_KEY"] ?? "",
  });

  async function run() {
    const result = await orq.memoryStores.retrieveDocument({
      memoryStoreKey: "<value>",
      memoryEntityId: "<id>",
      documentId: "<id>",
    });

    console.log(result);
  }

  run();
  ```
</CodeGroup>

<Expandable title="Parameters">
  <CodeGroup>
    ```python Python theme={"theme":{"light":"github-light","dark":"github-dark"}}
    {
        "memory_store_key": str,  # required
        "memory_entity_id": str,  # required
        "document_id": str,  # required
    }
    ```

    ```typescript Node.js theme={"theme":{"light":"github-light","dark":"github-dark"}}
    {
      memoryStoreKey: string;  // required
      memoryEntityId: string;  // required
      documentId: string;  // required
    }
    ```
  </CodeGroup>
</Expandable>

<Expandable title="Response">
  <CodeGroup>
    ```python Python theme={"theme":{"light":"github-light","dark":"github-dark"}}
    {
        "id": str,
        "memory_id": str,
        "store_id": str,
        "text": str,
        "created": str,
        "updated": str,
        "created_by_id": OptionalNullable[str],
        "updated_by_id": OptionalNullable[str],
        "workspace_id": str,
        "metadata": Dict[str, str],
    }
    ```

    ```typescript Node.js theme={"theme":{"light":"github-light","dark":"github-dark"}}
    {
      id: string;
      memoryId: string;
      storeId: string;
      text: string;
      created: string;
      updated: string;
      createdById?: string;
      updatedById?: string;
      workspaceId: string;
      metadata?: Record<string, string>;
    }
    ```
  </CodeGroup>
</Expandable>

### Update Document

Updates the details of a specific memory document.

<CodeGroup>
  ```python Python theme={"theme":{"light":"github-light","dark":"github-dark"}}
  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)

  ```

  ```typescript Node.js theme={"theme":{"light":"github-light","dark":"github-dark"}}
  import { Orq } from "@orq-ai/node";

  const orq = new Orq({
    apiKey: process.env["ORQ_API_KEY"] ?? "",
  });

  async function run() {
    const result = await orq.memoryStores.updateDocument({
      memoryStoreKey: "<value>",
      memoryEntityId: "<id>",
      documentId: "<id>",
    });

    console.log(result);
  }

  run();
  ```
</CodeGroup>

<Expandable title="Parameters">
  <CodeGroup>
    ```python Python theme={"theme":{"light":"github-light","dark":"github-dark"}}
    {
        "memory_store_key": str,  # required
        "memory_entity_id": str,  # required
        "document_id": str,  # required
        "text": Optional[str],
        "metadata": Dict[str, str],
    }
    ```

    ```typescript Node.js theme={"theme":{"light":"github-light","dark":"github-dark"}}
    {
      memoryStoreKey: string;  // required
      memoryEntityId: string;  // required
      documentId: string;  // required
      requestBody?: {
        text?: string;
        metadata?: Record<string, string>;
      };
    }
    ```
  </CodeGroup>
</Expandable>

<Expandable title="Response">
  <CodeGroup>
    ```python Python theme={"theme":{"light":"github-light","dark":"github-dark"}}
    {
        "id": str,
        "memory_id": str,
        "store_id": str,
        "text": str,
        "created": str,
        "updated": str,
        "created_by_id": OptionalNullable[str],
        "updated_by_id": OptionalNullable[str],
        "workspace_id": str,
        "metadata": Dict[str, str],
    }
    ```

    ```typescript Node.js theme={"theme":{"light":"github-light","dark":"github-dark"}}
    {
      id: string;
      memoryId: string;
      storeId: string;
      text: string;
      created: string;
      updated: string;
      createdById?: string;
      updatedById?: string;
      workspaceId: string;
      metadata?: Record<string, string>;
    }
    ```
  </CodeGroup>
</Expandable>

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

<CodeGroup>
  ```python Python theme={"theme":{"light":"github-light","dark":"github-dark"}}
  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 ...

  ```

  ```typescript Node.js theme={"theme":{"light":"github-light","dark":"github-dark"}}
  import { Orq } from "@orq-ai/node";

  const orq = new Orq({
    apiKey: process.env["ORQ_API_KEY"] ?? "",
  });

  async function run() {
    await orq.memoryStores.deleteDocument({
      memoryStoreKey: "<value>",
      memoryEntityId: "<id>",
      documentId: "<id>",
    });

  }

  run();
  ```
</CodeGroup>

<Expandable title="Parameters">
  <CodeGroup>
    ```python Python theme={"theme":{"light":"github-light","dark":"github-dark"}}
    {
        "memory_store_key": str,  # required
        "memory_entity_id": str,  # required
        "document_id": str,  # required
    }
    ```

    ```typescript Node.js theme={"theme":{"light":"github-light","dark":"github-dark"}}
    {
      memoryStoreKey: string;  // required
      memoryEntityId: string;  // required
      documentId: string;  // required
    }
    ```
  </CodeGroup>
</Expandable>
