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

# Memory Stores SDK Reference

> Manage memory stores with the Node.js and Python SDKs: create and update stores and manage memories and documents for agent memory context.

## Memory Stores

### List Memory Stores

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": [{
            "key": str,
            "description": str,
            "created_by_id": Optional[str],
            "updated_by_id": Optional[str],
            "created": str,
            "updated": str,
            "ttl": Optional[float],
            "embedding_config": {
                "model": str,
            },
            "id": str,
        }],
        "has_more": bool,
    }
    ```

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

### Create a Memory Store

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(key="<key>", embedding_config={
          "model": "cohere/embed-v4.0",
      }, description="Conversation history for support agents", 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-v4.0",
      },
      description: "Conversation history for support agents",
      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
        "path": str,  # required
        "ttl": Optional[float],
    }
    ```

    ```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"}}
    {
        "key": str,
        "description": str,
        "created_by_id": Optional[str],
        "updated_by_id": Optional[str],
        "created": str,
        "updated": str,
        "ttl": Optional[float],
        "embedding_config": {
            "model": str,
        },
        "id": str,
    }
    ```

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

### Retrieve a Memory Store

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"}}
    {
        "key": str,
        "description": str,
        "created_by_id": Optional[str],
        "updated_by_id": Optional[str],
        "created": str,
        "updated": str,
        "ttl": Optional[float],
        "embedding_config": {
            "model": str,
        },
        "id": str,
    }
    ```

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

### Delete a Memory Store

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>

### Update a Memory Store

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>")

      # 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>",
      updateMemoryStoreRequest: {},
    });

    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": Optional[float],
        "path": Optional[str],
        "project_id": Optional[str],
    }
    ```

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

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

    ```typescript Node.js theme={"theme":{"light":"github-light","dark":"github-dark"}}
    {
      key: string;
      description: string;
      createdById?: string;
      updatedById?: string;
      created: string;
      updated: string;
      ttl?: number;
      embeddingConfig: {
        model: string;
      };
      id: string;
    }
    ```
  </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": [{
            "entity_id": str,
            "created": str,
            "updated": str,
            "created_by_id": Optional[str],
            "updated_by_id": Optional[str],
            "store_id": str,
            "workspace_id": str,
            "documents_count": float,
            "metadata": Dict[str, str],  # optional
            "id": str,
        }],
        "has_more": bool,
    }
    ```

    ```typescript Node.js theme={"theme":{"light":"github-light","dark":"github-dark"}}
    {
      object: "list";
      data: {
        entityId: string;
        created: string;
        updated: string;
        createdById?: string;
        updatedById?: string;
        storeId: string;
        workspaceId: string;
        documentsCount: number;
        metadata?: Record<string, string>;
        id: string;
      }[];
      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>",
      createMemoryRequest: {
        entityId: "<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
        "entity_id": str,  # required
    }
    ```

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

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

    ```typescript Node.js theme={"theme":{"light":"github-light","dark":"github-dark"}}
    {
      entityId: string;
      created: string;
      updated: string;
      createdById?: string;
      updatedById?: string;
      storeId: string;
      workspaceId: string;
      documentsCount: number;
      metadata?: Record<string, string>;
      id: string;
    }
    ```
  </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"}}
    {
        "entity_id": str,
        "created": str,
        "updated": str,
        "created_by_id": Optional[str],
        "updated_by_id": Optional[str],
        "store_id": str,
        "workspace_id": str,
        "documents_count": float,
        "metadata": Dict[str, str],  # optional
        "id": str,
    }
    ```

    ```typescript Node.js theme={"theme":{"light":"github-light","dark":"github-dark"}}
    {
      entityId: string;
      created: string;
      updated: string;
      createdById?: string;
      updatedById?: string;
      storeId: string;
      workspaceId: string;
      documentsCount: number;
      metadata?: Record<string, string>;
      id: string;
    }
    ```
  </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>

### 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>",
      updateMemoryRequest: {},
    });

    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],  # optional
    }
    ```

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

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

    ```typescript Node.js theme={"theme":{"light":"github-light","dark":"github-dark"}}
    {
      entityId: string;
      created: string;
      updated: string;
      createdById?: string;
      updatedById?: string;
      storeId: string;
      workspaceId: string;
      documentsCount: number;
      metadata?: Record<string, string>;
      id: string;
    }
    ```
  </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": str,  # optional
        "updated_before": str,  # optional
    }
    ```

    ```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": [{
            "memory_id": str,
            "store_id": str,
            "text": str,
            "created": str,
            "updated": str,
            "created_by_id": Optional[str],
            "updated_by_id": Optional[str],
            "workspace_id": str,
            "metadata": Dict[str, str],  # optional
            "id": str,
        }],
        "has_more": bool,
    }
    ```

    ```typescript Node.js theme={"theme":{"light":"github-light","dark":"github-dark"}}
    {
      object: "list";
      data: {
        memoryId: string;
        storeId: string;
        text: string;
        created: string;
        updated: string;
        createdById?: string;
        updatedById?: string;
        workspaceId: string;
        metadata?: Record<string, string>;
        id: 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>",
      createMemoryDocumentRequest: {
        text: "<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
        "memory_entity_id": str,  # required
        "text": str,  # required
        "metadata": Dict[str, str],  # optional
    }
    ```

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

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

    ```typescript Node.js theme={"theme":{"light":"github-light","dark":"github-dark"}}
    {
      memoryId: string;
      storeId: string;
      text: string;
      created: string;
      updated: string;
      createdById?: string;
      updatedById?: string;
      workspaceId: string;
      metadata?: Record<string, string>;
      id: 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"}}
    {
        "memory_id": str,
        "store_id": str,
        "text": str,
        "created": str,
        "updated": str,
        "created_by_id": Optional[str],
        "updated_by_id": Optional[str],
        "workspace_id": str,
        "metadata": Dict[str, str],  # optional
        "id": str,
    }
    ```

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

### 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>",
      updateMemoryDocumentRequest: {},
    });

    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],  # optional
    }
    ```

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

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

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


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.