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

# Embeddings + FAISS Integration

> Use SynapsAI embeddings with FAISS for similarity search

## Embeddings + similarity search (Python + FAISS)

1. Request embeddings from SynapsAI.
2. Insert into FAISS (or whichever vector DB you use).
3. Query by embedding similarity.

```python theme={null}
from synapsai import SynapsAI
import numpy as np
import faiss

client = SynapsAI()

texts = ["Alpha example", "Beta features", "Gamma release notes"]
embeddings = [client.embeddings.create(model="<YOUR_EMBEDDING_MODEL_ID>", input=t).data[0].embedding for t in texts]

d = len(embeddings[0])
index = faiss.IndexFlatL2(d)
index.add(np.array(embeddings).astype("float32"))

q_emb = client.embeddings.create(model="<YOUR_EMBEDDING_MODEL_ID>", input="Tell me about release features").data[0].embedding
D, I = index.search(np.array([q_emb]).astype("float32"), k=2)
print("Top indices:", I[0], "distances:", D[0])
```
