---
title: "Ten Minutes — Context Infrastructure"
description: "Store and retrieve your first context in under ten minutes."
canonical: "https://press.getalchemystai.com/books/context-infrastructure-build-ai-that-understands-your-business/ten-minutes"
last_updated: "2018-10-20"
book: "Context Infrastructure"
label: "Chapter 5"
---

# Ten Minutes

*For developers, AI engineers and forward-deployed engineers. How to get context in, get the right context out, and know why.*

You can store and retrieve your first context in under ten minutes. You need an API key, one SDK, and a document worth asking about.

1. **Get a key.** Sign in at `platform.getalchemystai.com` with a Google account, choose **Get Started**, and generate a key. Keys are managed later under **Settings**.
2. **Set it in your environment** as `ALCHEMYST_AI_API_KEY`. Both SDKs read it by default.
3. **Install an SDK.** `npm install @alchemystai/sdk` (Node 18+) or `pip install alchemystai` (Python 3.9+). Both are Apache-2.0.
4. **Add, then search**, as below.

```ts
import AlchemystAI from '@alchemystai/sdk';

const client = new AlchemystAI(); // reads ALCHEMYST_AI_API_KEY

// 1. Store a document, scoped to support policy
await client.v1.context.add({
  context_type: 'resource', // 'resource' | 'conversation' | 'instruction'
  scope: 'internal',
  source: 'handbook-quickstart',
  documents: [{ content: 'Refunds are issued within 7 days of the return being received.' }],
  metadata: {
    fileName: 'refund-policy.md', // also the deduplication key
    fileType: 'text/markdown',
    groupName: ['support', 'policy'],
  },
});

// 2. Ask a question inside the support scope
const { contexts } = await client.v1.context.search({
  query: 'How long do refunds take?',
  similarity_threshold: 0.8,
  minimum_similarity_threshold: 0.5,
  scope: 'internal',
  body_metadata: { groupName: ['support'] },
});

for (const c of contexts ?? []) console.log(c.score, c.content);
```

The Python SDK mirrors the same resources:

```python
from alchemyst_ai import AlchemystAI

client = AlchemystAI()  # reads ALCHEMYST_AI_API_KEY

client.v1.context.add(
    context_type="resource",
    scope="internal",
    source="handbook-quickstart",
    documents=[{"content": "Refunds are issued within 7 days of the return being received."}],
    metadata={"fileName": "refund-policy.md", "groupName": ["support", "policy"]},
)

result = client.v1.context.search(
    query="How long do refunds take?",
    similarity_threshold=0.8,
    minimum_similarity_threshold=0.5,
    scope="internal",
)
```

**Your first agent.** The official CLI pattern takes about ten minutes: read a question from the terminal, search Alchemyst for context, inject the results into the prompt, and let any LLM answer. Every agent in this book is a variation of those four steps.

---

- Previous: [Chapter 4: The Map](https://press.getalchemystai.com/books/context-infrastructure-build-ai-that-understands-your-business/the-map.md)
- Contents: [Context Infrastructure](https://press.getalchemystai.com/books/context-infrastructure-build-ai-that-understands-your-business.md)
- Next: [Chapter 6: The Arithmetic](https://press.getalchemystai.com/books/context-infrastructure-build-ai-that-understands-your-business/the-arithmetic.md)
