# `GEPA.Adapters.GenericRAG.VectorStore`
[🔗](https://github.com/nshkrdotcom/gepa_ex/blob/v0.3.0/lib/gepa/adapters/generic_rag/vector_store.ex#L1)

Behaviour for vector-store backends used by `GEPA.Adapters.GenericRAG`.

Documents are maps with at least `:content`/`"content"` and optional
`:metadata`/`"metadata"`. Search callbacks may return either a list directly
or `{:ok, list}`/`{:error, reason}` when the backend performs external IO.

# `document`

```elixir
@type document() :: %{optional(String.t() | atom()) =&gt; term()}
```

# `filters`

```elixir
@type filters() :: map() | nil
```

# `search_result`

```elixir
@type search_result() :: [document()] | {:ok, [document()]} | {:error, term()}
```

# `create_collection`
*optional* 

```elixir
@callback create_collection(term(), keyword() | map()) :: :ok | {:error, term()}
```

# `delete_documents`
*optional* 

```elixir
@callback delete_documents(term(), [term()], keyword() | map()) :: :ok | {:error, term()}
```

# `embedding_dimension`
*optional* 

```elixir
@callback embedding_dimension(term()) :: pos_integer() | nil
```

# `get_collection_info`

```elixir
@callback get_collection_info(term()) :: map()
```

# `health_check`
*optional* 

```elixir
@callback health_check(term()) :: :ok | {:error, term()}
```

# `reset_collection`
*optional* 

```elixir
@callback reset_collection(term(), keyword() | map()) :: :ok | {:error, term()}
```

# `similarity_search`

```elixir
@callback similarity_search(term(), String.t(), pos_integer(), filters()) ::
  search_result()
```

# `supports_hybrid_search?`
*optional* 

```elixir
@callback supports_hybrid_search?(term()) :: boolean()
```

# `supports_metadata_filtering?`
*optional* 

```elixir
@callback supports_metadata_filtering?(term()) :: boolean()
```

# `upsert_documents`
*optional* 

```elixir
@callback upsert_documents(term(), [document()], keyword() | map()) ::
  {:ok, [term()]} | {:error, term()}
```

# `vector_search`

```elixir
@callback vector_search(term(), [number()], pos_integer(), filters()) :: search_result()
```

# `create_collection`

```elixir
@spec create_collection(term(), keyword() | map()) :: :ok | {:error, term()}
```

# `delete_documents`

```elixir
@spec delete_documents(term(), [term()], keyword() | map()) :: :ok | {:error, term()}
```

# `embedding_dimension`

```elixir
@spec embedding_dimension(term()) :: pos_integer() | nil
```

# `get_collection_info`

```elixir
@spec get_collection_info(term()) :: map()
```

# `health_check`

```elixir
@spec health_check(term()) :: :ok | {:error, term()}
```

# `hybrid_search`

```elixir
@spec hybrid_search(term(), String.t(), pos_integer(), float()) :: search_result()
```

Perform a hybrid search. Defaults to similarity search.

# `reset_collection`

```elixir
@spec reset_collection(term(), keyword() | map()) :: :ok | {:error, term()}
```

# `similarity_search`

```elixir
@spec similarity_search(term(), String.t(), pos_integer(), filters()) ::
  search_result()
```

# `supports_hybrid_search?`

```elixir
@spec supports_hybrid_search?(term()) :: boolean()
```

# `supports_metadata_filtering?`

```elixir
@spec supports_metadata_filtering?(term()) :: boolean()
```

# `upsert_documents`

```elixir
@spec upsert_documents(term(), [document()], keyword() | map()) ::
  {:ok, [term()]} | {:error, term()}
```

# `vector_search`

```elixir
@spec vector_search(term(), [number()], pos_integer(), filters()) :: search_result()
```

---

*Consult [api-reference.md](api-reference.md) for complete listing*
