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

# Quickstart

> Get started with Neode in 5 minutes

## Prerequisites

* A Neode account ([sign up here](https://neode.ai/auth))
* Your API key (available in your [dashboard settings](https://neode.ai/dashboard/settings/api-keys))

## Step 1: Create an Index

Indexes organize your entities into separate namespaces. Create one for your project:

<CodeGroup>
  ```bash cURL theme={null}
  curl -X POST https://neode.ai/api/indexes \
    -H "Content-Type: application/json" \
    -H "Authorization: Bearer YOUR_API_KEY" \
    -d '{
      "name": "My Knowledge Base",
      "description": "Facts about technology companies"
    }'
  ```

  ```javascript JavaScript theme={null}
  const response = await fetch('https://neode.ai/api/indexes', {
    method: 'POST',
    headers: {
      'Content-Type': 'application/json',
      'Authorization': 'Bearer YOUR_API_KEY'
    },
    body: JSON.stringify({
      name: 'My Knowledge Base',
      description: 'Facts about technology companies'
    })
  });

  const { data: index } = await response.json();
  console.log('Index ID:', index.id);
  ```

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

  response = requests.post(
      'https://neode.ai/api/indexes',
      headers={
          'Content-Type': 'application/json',
          'Authorization': 'Bearer YOUR_API_KEY'
      },
      json={
          'name': 'My Knowledge Base',
          'description': 'Facts about technology companies'
      }
  )

  index = response.json()['data']
  print(f"Index ID: {index['id']}")
  ```
</CodeGroup>

<Note>Save the `index_id` from the response - you'll need it for storing triples.</Note>

## Step 2: Store Your First Triple

A triple represents a fact as subject-predicate-object. Let's store a fact about Tesla:

<CodeGroup>
  ```bash cURL theme={null}
  curl -X POST https://neode.ai/api/triples \
    -H "Content-Type: application/json" \
    -H "Authorization: Bearer YOUR_API_KEY" \
    -d '{
      "subject": "Tesla",
      "predicate": "founded_by",
      "object": "Elon Musk",
      "object_type": "entity",
      "confidence": 0.95,
      "index_id": "YOUR_INDEX_ID"
    }'
  ```

  ```javascript JavaScript theme={null}
  const response = await fetch('https://neode.ai/api/triples', {
    method: 'POST',
    headers: {
      'Content-Type': 'application/json',
      'Authorization': 'Bearer YOUR_API_KEY'
    },
    body: JSON.stringify({
      subject: 'Tesla',
      predicate: 'founded_by',
      object: 'Elon Musk',
      object_type: 'entity',
      confidence: 0.95,
      index_id: 'YOUR_INDEX_ID'
    })
  });

  const { data: triple } = await response.json();
  console.log('Triple created:', triple.id);
  ```

  ```python Python theme={null}
  response = requests.post(
      'https://neode.ai/api/triples',
      headers={
          'Content-Type': 'application/json',
          'Authorization': 'Bearer YOUR_API_KEY'
      },
      json={
          'subject': 'Tesla',
          'predicate': 'founded_by',
          'object': 'Elon Musk',
          'object_type': 'entity',
          'confidence': 0.95,
          'index_id': 'YOUR_INDEX_ID'
      }
  )

  triple = response.json()['data']
  print(f"Triple created: {triple['id']}")
  ```
</CodeGroup>

<Tip>
  **Object Types:**

  * Use `"entity"` when the object is another entity (person, company, place)
  * Use `"literal"` for values like dates, numbers, or descriptions
</Tip>

## Step 3: Query Your Knowledge

Retrieve triples about a specific subject:

<CodeGroup>
  ```bash cURL theme={null}
  curl "https://neode.ai/api/triples?subject=Tesla" \
    -H "Authorization: Bearer YOUR_API_KEY"
  ```

  ```javascript JavaScript theme={null}
  const response = await fetch(
    'https://neode.ai/api/triples?subject=Tesla',
    {
      headers: { 'Authorization': 'Bearer YOUR_API_KEY' }
    }
  );

  const { data: triples } = await response.json();
  triples.forEach(t => {
    console.log(`${t.subject} → ${t.predicate} → ${t.object}`);
  });
  ```

  ```python Python theme={null}
  response = requests.get(
      'https://neode.ai/api/triples',
      params={'subject': 'Tesla'},
      headers={'Authorization': 'Bearer YOUR_API_KEY'}
  )

  triples = response.json()['data']
  for t in triples:
      print(f"{t['subject']} → {t['predicate']} → {t['object']}")
  ```
</CodeGroup>

## Step 4: Generate Triples with AI

Use AI to automatically extract knowledge from natural language:

<CodeGroup>
  ```bash cURL theme={null}
  curl -X POST "https://neode.ai/api/triples/generate?format=json" \
    -H "Content-Type: application/json" \
    -H "Authorization: Bearer YOUR_API_KEY" \
    -d '{
      "query": "Extract key facts about SpaceX and its achievements",
      "index_id": "YOUR_INDEX_ID",
      "web_search": true,
      "triple_count": 10
    }'
  ```

  ```javascript JavaScript theme={null}
  const response = await fetch(
    'https://neode.ai/api/triples/generate?format=json',
    {
      method: 'POST',
      headers: {
        'Content-Type': 'application/json',
        'Authorization': 'Bearer YOUR_API_KEY'
      },
      body: JSON.stringify({
        query: 'Extract key facts about SpaceX and its achievements',
        index_id: 'YOUR_INDEX_ID',
        web_search: true,
        triple_count: 10
      })
    }
  );

  const { data: triples } = await response.json();
  console.log(`Generated ${triples.length} triples`);
  ```

  ```python Python theme={null}
  response = requests.post(
      'https://neode.ai/api/triples/generate',
      params={'format': 'json'},
      headers={
          'Content-Type': 'application/json',
          'Authorization': 'Bearer YOUR_API_KEY'
      },
      json={
          'query': 'Extract key facts about SpaceX and its achievements',
          'index_id': 'YOUR_INDEX_ID',
          'web_search': True,
          'triple_count': 10
      }
  )

  triples = response.json()['data']
  print(f"Generated {len(triples)} triples")
  ```
</CodeGroup>

<Warning>
  AI generation uses credits. Check your balance in the [dashboard](https://neode.ai/dashboard/settings/billing).
</Warning>

## Next Steps

<CardGroup cols={2}>
  <Card title="Core Concepts" icon="book" href="/concepts">
    Learn about triples, entities, indexes, and graphs.
  </Card>

  <Card title="Working with Triples" icon="share-nodes" href="/guides/triples">
    Deep dive into creating, querying, and managing triples.
  </Card>

  <Card title="AI Generation" icon="sparkles" href="/guides/ai-generation">
    Advanced AI generation with web search and custom predicates.
  </Card>

  <Card title="API Reference" icon="code" href="/api-reference/introduction">
    Complete API documentation with all endpoints.
  </Card>
</CardGroup>
