Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Move GenAI page to getting-started directory and update SUMMARY.md
Co-Authored-By: Francisco Javier Arceo <farceo@redhat.com>
  • Loading branch information
commit 06ae0f7e88ace2d722092bd9a1a85680d0e9b81a
2 changes: 1 addition & 1 deletion docs/SUMMARY.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
## Getting started

* [Quickstart](getting-started/quickstart.md)
* [GenAI](getting-started/genai.md)
* [Feast for Generative AI](getting-started/genai.md)
* [Architecture](getting-started/architecture/README.md)
* [Overview](getting-started/architecture/overview.md)
* [Language](getting-started/architecture/language.md)
Expand Down
175 changes: 0 additions & 175 deletions docs/genai.md

This file was deleted.

107 changes: 100 additions & 7 deletions docs/getting-started/genai.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

## Overview

Feast provides robust support for Generative AI applications, enabling teams to build, deploy, and manage feature infrastructure for Large Language Models (LLMs) and other Generative AI (GenAI) applications. With Feast's vector database integrations and feature management capabilities, teams can implement production-ready Retrieval Augmented Generation (RAG) systems and other GenAI applications with the same reliability and operational excellence as traditional ML systems.
Feast provides robust support for Generative AI applications, enabling teams to build, deploy, and manage feature infrastructure for Large Language Models (LLMs) and other generative AI systems. With Feast's vector database integrations and feature management capabilities, teams can implement production-ready Retrieval Augmented Generation (RAG) systems and other GenAI applications with the same reliability and operational excellence as traditional ML systems.

## Key Capabilities for GenAI

Expand All @@ -17,17 +17,17 @@ Feast integrates with popular vector databases to store and retrieve embedding v
* **Qdrant**: Purpose-built vector database integration

These integrations allow you to:
- Store embeddings as features
- Store document embeddings as features
- Perform vector similarity search to find relevant context
- Retrieve both vector embeddings and traditional features in a single API call

### Retrieval Augmented Generation (RAG)

Feast simplifies building RAG applications by providing:

1. **Embedding storage**: Store and version embeddings alongside your other features
2. **Vector similarity search**: Find the most relevant data/documents for a given query
3. **Feature retrieval**: Combine embeddings with structured features for richer context
1. **Document embedding storage**: Store and version document embeddings alongside your other features
2. **Vector similarity search**: Find the most relevant documents for a given query
3. **Feature retrieval**: Combine document embeddings with structured features for richer context
4. **Versioning and governance**: Track changes to your document repository over time

The typical RAG workflow with Feast involves:
Expand Down Expand Up @@ -59,12 +59,105 @@ The transformation workflow typically involves:

### Feature Transformation for LLMs

Feast supports transformations that can be used to:
Feast supports on-demand transformations that can be used to:

* Process raw text into embeddings
* Chunk documents for more effective retrieval
* Normalize and preprocess features before serving to LLMs
* Apply custom transformations to adapt features for specific LLM requirements

### Getting Started with Feast for GenAI

#### Installation

To use Feast with vector database support, install with the appropriate extras:

```bash
# For Milvus support
pip install feast[milvus,nlp]

# For Elasticsearch support
pip install feast[elasticsearch]

# For Qdrant support
pip install feast[qdrant]

# For SQLite support (Python 3.10 only)
pip install feast[sqlite_vec]
```

#### Configuration

Configure your feature store to use a vector database as the online store:

```yaml
project: genai-project
provider: local
registry: data/registry.db
online_store:
type: milvus
path: data/online_store.db
vector_enabled: true
embedding_dim: 384 # Adjust based on your embedding model
index_type: "IVF_FLAT"

offline_store:
type: file
entity_key_serialization_version: 3
```

#### Defining Vector Features

Create feature views with vector index support:

```python
from feast import FeatureView, Field, Entity
from feast.types import Array, Float32, String

document = Entity(
name="document_id",
description="Document identifier",
join_keys=["document_id"],
)

document_embeddings = FeatureView(
name="document_embeddings",
entities=[document],
schema=[
Field(
name="vector",
dtype=Array(Float32),
vector_index=True, # Enable vector search
vector_search_metric="COSINE", # Similarity metric
),
Field(name="document_id", dtype=String),
Field(name="content", dtype=String),
],
source=document_source,
ttl=timedelta(days=30),
)
```

#### Retrieving Similar Documents

Use the `retrieve_online_documents_v2` method to find similar documents:

```python
# Generate query embedding
query = "How does Feast support vector databases?"
query_embedding = embed_text(query) # Your embedding function

# Retrieve similar documents
context_data = store.retrieve_online_documents_v2(
features=[
"document_embeddings:vector",
"document_embeddings:document_id",
"document_embeddings:content",
],
query=query_embedding,
top_k=3,
distance_metric='COSINE',
).to_df()
```

## Use Cases

Expand Down