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

# Quickstart

> Upload and recall your first memory

## Prerequisites

You'll need an Engramme API key with access to the `text` source type. For the simplest setup, create an **All Sources** key in [app.engramme.com](https://app.engramme.com).

```bash theme={null}
export ENGRAMME_API_KEY="YOUR_API_KEY"
```

## Step 1: Check API Health

First, verify the API is reachable by checking the health endpoint:

```bash theme={null}
curl https://memorymachines-gateway-prod-btf57kda.uc.gateway.dev/v1/health
```

You should see:

```json theme={null}
{
  "status": "healthy",
  "message": "Memory Machines Platform API is running."
}
```

## Step 2: Upload Your First Document

Create a sample text file:

```bash theme={null}
cat > meeting-notes.txt <<'EOF'
Meeting Notes - January 15, 2025

Attendees: Sarah, Mike, Jennifer

We discussed the Q1 roadmap today. Sarah presented the new authentication
feature timeline - targeting end of February for beta. Mike raised concerns
about the current API response times, suggesting we prioritize performance
optimization before the launch.

Action items:
- Sarah: Finalize auth feature specs by Friday
- Mike: Run performance benchmarks this week
- Jennifer: Schedule follow-up for next Tuesday
EOF
```

Now upload it:

<CodeGroup>
  ```bash curl theme={null}
  curl -X POST https://memorymachines-gateway-prod-btf57kda.uc.gateway.dev/v1/memorize \
    -H "x-api-key: $ENGRAMME_API_KEY" \
    -F "file=@meeting-notes.txt" \
    -F "user_name=Your Name" \
    -F "source_type=text"
  ```

  ```python Python theme={null}
  import os
  import requests

  url = "https://memorymachines-gateway-prod-btf57kda.uc.gateway.dev/v1/memorize"
  headers = {"x-api-key": os.environ["ENGRAMME_API_KEY"]}

  with open("meeting-notes.txt", "rb") as f:
      files = {"file": f}
      data = {"user_name": "Your Name", "source_type": "text"}
      response = requests.post(url, headers=headers, files=files, data=data)

  print(response.json())
  ```

  ```javascript JavaScript theme={null}
  const apiKey = process.env.ENGRAMME_API_KEY;
  const formData = new FormData();
  formData.append('file', new Blob(['your content'], { type: 'text/plain' }), 'notes.txt');
  formData.append('user_name', 'Your Name');
  formData.append('source_type', 'text');

  const response = await fetch(
    'https://memorymachines-gateway-prod-btf57kda.uc.gateway.dev/v1/memorize',
    {
      method: 'POST',
      headers: { 'x-api-key': apiKey },
      body: formData
    }
  );

  console.log(await response.json());
  ```
</CodeGroup>

### Choose a source type

The `source_type` field tells Engramme where the content came from. For this guide, use `text`. See [Source Types](/reference/source-types) for the full list.

<Note>
  API keys can be scoped to specific source types. If your key does not include `text`, this upload will be rejected.
</Note>

You'll receive a response like:

```json theme={null}
{
  "status": "success",
  "user_id": "your_user_id",
  "item_id": "abc123",
  "workflow_execution": "projects/.../executions/exec-xyz"
}
```

<Info>
  `/v1/memorize` returns when processing has started. Memories may take a short time to become recallable.
</Info>

## Step 3: Recall Raw Memories

Wait briefly for processing, then retrieve relevant memories:

```bash theme={null}
curl -X POST https://memorymachines-gateway-prod-btf57kda.uc.gateway.dev/v1/memories/recall \
  -H "x-api-key: $ENGRAMME_API_KEY" \
  -F "text=meeting"
```

Response:

```json theme={null}
{
  "memories": [
    {
      "custom_id": "abc123_memory_0",
      "item_id": "abc123",
      "score": 0.94,
      "content": {
        "narrative": "I attended a meeting with Sarah, Mike, and Jennifer to discuss the Q1 roadmap. Sarah presented the authentication feature timeline targeting end of February. Mike raised concerns about API response times.",
        "participants": ["Sarah", "Mike", "Jennifer"],
        "when": "January 15, 2025",
        "where": null,
        "tags": ["meeting", "Q1", "roadmap", "authentication"]
      }
    }
  ],
  "qa": [],
  "chunks": []
}
```

<Note>
  If no memories are returned immediately, retry after a short delay. Very short or synthetic uploads may not always produce a recallable memory.
</Note>

## Next Steps

<CardGroup cols={2}>
  <Card title="Authentication" icon="key" href="/authentication">
    Learn about API key management
  </Card>

  <Card title="Source Types" icon="code" href="/reference/source-types">
    Pick the right `source_type`
  </Card>
</CardGroup>

## Common Issues

<AccordionGroup>
  <Accordion title="401 Unauthorized">
    Your API key is invalid or missing. Make sure you're including the `x-api-key` header with your request.
  </Accordion>

  <Accordion title="No memories returned">
    Processing takes 10-15 seconds. Wait a moment and try again. You can also check if the document was uploaded successfully by looking at the response from `/v1/memorize`.
  </Accordion>

  <Accordion title="400 Bad Request">
    Check that your file and parameters are valid. For text uploads, files must be UTF-8 encoded and under 10MB. Also make sure `source_type` is one of the supported values listed above.
  </Accordion>
</AccordionGroup>
