# create_index

> **Function** in `langchain_community`

📖 [View in docs](https://reference.langchain.com/python/langchain-community/retrievers/nanopq/create_index)

Create an index of embeddings for a list of contexts.

## Signature

```python
create_index(
    contexts: List[str],
    embeddings: Embeddings,
) -> np.ndarray
```

## Parameters

| Name | Type | Required | Description |
|------|------|----------|-------------|
| `contexts` | `List[str]` | Yes | List of contexts to embed. |
| `embeddings` | `Embeddings` | Yes | Embeddings model to use. |

## Returns

`np.ndarray`

Index of embeddings.

---

[View source on GitHub](https://github.com/langchain-ai/langchain-community/blob/4b280287bd55b99b44db2dd849f02d66c89534d5/libs/community/langchain_community/retrievers/nanopq.py#L14)