# Manage memories

You can retrieve and delete individual [memories](../engram-concepts/memories.md) using their ID.

::::accordion{title="All examples below use a connected client"}
See [Connect to Engram](../engram/quickstart.md#step-3-connect-to-engram) for how to instantiate one.

:::code-group{sync="languages"}
```python title="Python"
import os
from engram import EngramClient

client = EngramClient(api_key=os.environ["ENGRAM_API_KEY"])
```

```python title="Python (Async)"
import os
from engram import AsyncEngramClient

client = AsyncEngramClient(api_key=os.environ["ENGRAM_API_KEY"])
```

```bash title="cURL"
export ENGRAM_API_KEY="eng_..."
```
:::
::::

## Get a memory

Retrieve a single memory by its ID.

:::code-group{sync="languages"}
```python title="Python"
memory = client.memories.get(
    memory_id,
    user_id=test_user_id,
    group="default",
)

print(memory.content)
print(memory.topic)
```

```pyindent title="Python (Async)"
memory = await client.memories.get(
    memory_id,
    user_id=test_user_id,
    group="default",
)

print(memory.content)
print(memory.topic)
```

```bash title="cURL"
curl "https://api.engram.weaviate.io/v1/memories/{memory-id}?user_id=user-uuid&group=default" \
  -H "Authorization: Bearer $ENGRAM_API_KEY"
```
:::

### Query parameters

| Parameter | Type   | Description                                                                       |
| --------- | ------ | --------------------------------------------------------------------------------- |
| `user_id` | string | User [scope](../engram-concepts/scopes.md) (required if the topic is user-scoped) |
| `group`   | string | The memory [group](../engram-concepts/groups.md) name (defaults to `default`)     |

### Response

```json
{
  "id": "memory-uuid",
  "project_id": "project-uuid",
  "user_id": "user-uuid",
  "content": "The user prefers dark mode.",
  "topic": "UserKnowledge",
  "group": "default",
  "properties": { "conversation_id": "abc-123" },
  "created_at": "2025-01-01T00:00:00Z",
  "updated_at": "2025-01-01T00:00:00Z"
}
```

## Delete a memory

Remove a memory permanently by its ID.

:::code-group{sync="languages"}
```python title="Python"
client.memories.delete(
    memory_id,
    user_id=test_user_id,
    group="default",
)
```

```pyindent title="Python (Async)"
await client.memories.delete(
    memory_id,
    user_id=test_user_id,
    group="default",
)
```

```bash title="cURL"
curl -X DELETE "https://api.engram.weaviate.io/v1/memories/{memory-id}?user_id=user-uuid&group=default" \
  -H "Authorization: Bearer $ENGRAM_API_KEY"
```
:::

The query parameters are the same as for the get request. You must provide the correct scoping parameters to identify the memory.

:::callout{intent="warning"}
Deleting a memory is permanent and cannot be undone.
:::

## Questions and feedback

Have a question or feedback? Here's how to reach us.

::::card-grid
:::card{title="Community Forum" href="https://forum.weaviate.io/c/support" icon="messages-square"}
Ask questions and connect with other developers on our **Community forum**.
:::

:::card{title="Support" href="/guides/support-overview" icon="life-buoy"}
Weaviate Cloud user or customer? Find the right channel on the **Support page**.
:::
::::

## Related pages

- [Agents](./agents-index.md)
- [AI-assisted Weaviate code generation](./ai-assisted-vibe-coding-index.md)
- [APIs](./apis-index.md)
- [Authorization and authentication](./authorization-and-authentication-index.md)
- [Benchmarks](./benchmarks-index.md)
- [Best practices](./best-practices-index.md)
- [Client libraries](./clients-index.md)
- [Client Libraries / SDKs](./client-libraries-index.md)
- [Cloud](./cloud-index.md)
- [Cloud account management](./cloud-account-management-index.md)

# Agent Instructions

This portal answers questions programmatically. To receive a synthesized,
source-cited answer instead of crawling page by page, append the `?ask=`
query parameter to any page URL on this site:

    /guides/quickstart?ask=how+do+I+authenticate

Optional parameters:

- `&goal=<what-you-are-trying-to-do>` steers the answer toward your
  objective (e.g. `&goal=write+a+python+client`).
- `&version=<label>` scopes the answer to a mounted version when the
  portal publishes more than one.

The response is `text/markdown`: the answer followed by a `# Sources` list
of the portal pages it was grounded in. Status codes are the contract:

- `200` — the answer; `402` — the portal owner’s plan or answer credits are
  exhausted (surface this to your operator; do NOT retry); `429` — you are
  rate-limited; back off for the `Retry-After` seconds; `503` — the answer
  lane is temporarily unavailable; fall back to crawling the `.md` pages.

For the full corpus map read `llms.txt` at the site root; for the tool
surface (search + page fetch as MCP tools) see `/mcp`.
