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

# Quickstart

> Get a vector in and out in under 5 minutes.

## 1. Get an API key

Sign up at [app.veclabs.xyz](https://app.veclabs.xyz/register). Your API key will be shown once — save it.

## 2. Install the SDK

<CodeGroup>
  ```bash TypeScript theme={null}
  npm install @veclabs/solvec
  ```

  ```bash Python theme={null}
  pip install solvec --pre
  ```
</CodeGroup>

## 3. Create a collection

<CodeGroup>
  ```typescript TypeScript theme={null}
  import { SolVec } from '@veclabs/solvec';

  const sv = new SolVec({ apiKey: process.env.RECALL_API_KEY });
  const collection = sv.collection('agent-memory', { dimensions: 1536 });

  ```

  ```python Python theme={null}
  from solvec import SolVec

  sv = SolVec(api_key=os.environ["RECALL_API_KEY"])
  collection = sv.collection("agent-memory", dimensions=1536)
  ```
</CodeGroup>

## 4. Upsert vectors

<CodeGroup>
  ```typescript TypeScript theme={null}
  await collection.upsert([{
    id: 'mem_001',
    values: embedding,         // float[] of length 1536
    metadata: { text: 'User prefers dark mode' }
  }]);
  ```

  ```python Python theme={null}
  collection.upsert([{
      "id": "mem_001",
      "values": embedding,     # list of 1536 floats
      "metadata": {"text": "User prefers dark mode"}
  }])
  ```
</CodeGroup>

The response includes a `merkleRoot` — a SHA-256 fingerprint of your collection. On Pro and above, this root is posted to the Solana Anchor program automatically.

## 5. Query

<CodeGroup>
  ```typescript TypeScript theme={null}
  const results = await collection.query({
    vector: queryEmbedding,
    topK: 5
  });

  // results.matches: [{ id, score, metadata }]

  ```

  ```python Python theme={null}
  results = collection.query(vector=query_embedding, top_k=5)

  # results.matches: [{"id": ..., "score": ..., "metadata": ...}]
  ```
</CodeGroup>

## 6. Verify (Pro and above)

```typescript TypeScript theme={null}
const proof = await collection.verify();
console.log(proof.solanaExplorerUrl);
// → https://explorer.solana.com/tx/...?cluster=devnet
```

The verify call fetches the on-chain Merkle root from Solana and computes it locally from your collection. If they match, your memory is intact and tamper-evident.

## What's free vs paid?

| Feature                | Free | Pro (\$25/mo) |
| ---------------------- | ---- | ------------- |
| Vectors                | 5K   | 500K          |
| Writes/mo              | 1K   | 50K           |
| Queries/mo             | 10K  | 500K          |
| Irys permanent storage | ❌    | ✅             |
| Merkle root → Solana   | ❌    | ✅             |

Free tier vectors live in Redis cache. Pro tier vectors are stored permanently on Arweave via Irys and anchored to Solana on every write.

## LangChain integration

<CodeGroup>
  ```bash TypeScript theme={null}
  npm install @veclabs/solvec @langchain/core
  ```

  ```bash Python theme={null}
  pip install solvec --pre langchain-core
  ```
</CodeGroup>

<CodeGroup>
  ```typescript TypeScript theme={null}
  import { RecallVectorStore } from '@veclabs/solvec/langchain';
  import { OpenAIEmbeddings } from '@langchain/openai';

  const store = await RecallVectorStore.fromTexts(
    ["User prefers dark mode", "Meeting at 3pm"],
    [{ source: "chat" }, { source: "calendar" }],
    new OpenAIEmbeddings(),
    { apiKey: process.env.RECALL_API_KEY, collection: "langchain-memory" }
  );

  const docs = await store.similaritySearch("user preferences", 3);
  ```

  ```python Python theme={null}
  from solvec.langchain import RecallVectorStore
  from langchain_openai import OpenAIEmbeddings

  store = RecallVectorStore(
      api_key=os.environ["RECALL_API_KEY"],
      collection="langchain-memory",
      embeddings=OpenAIEmbeddings(),
  )

  store.add_texts(["User prefers dark mode", "Meeting at 3pm"])
  docs = store.similarity_search("user preferences", k=3)
  ```
</CodeGroup>
