Skip to content

feat: Created DocEmbedder class#5973

Merged
ntkathole merged 8 commits intofeast-dev:masterfrom
patelchaitany:fet-DocEmbedder
Mar 16, 2026
Merged

feat: Created DocEmbedder class#5973
ntkathole merged 8 commits intofeast-dev:masterfrom
patelchaitany:fet-DocEmbedder

Conversation

@patelchaitany
Copy link
Contributor

@patelchaitany patelchaitany commented Feb 16, 2026

What this PR does / why we need it:

This PR adds a Document Embedder capability to Feast, allowing users to go from raw documents to embeddings stored in the online vector store in a single step. It handles chunking, embedding generation, and writing the results to the online store — providing an end-to-end ingestion pipeline for RAG workflows within Feast.

What changed:

sdk/python/feast/chunker.py

Defines the document chunking layer. Provides:

  • A BaseChunker abstract class that users can extend with custom chunking strategies
  • A built-in TextChunker that splits plain text by word count with configurable size, overlap, and thresholds
  • A chunk_dataframe() convenience method to chunk all documents in a DataFrame

Currently only basic text chunking is implemented. There is room for improvement — future iterations can support more advanced strategies like semantic chunking, sentence-aware splitting, or format-specific chunkers (PDF, HTML, etc.).

sdk/python/feast/embedder.py

Defines the embedding generation layer. Provides:

  • A BaseEmbedder abstract class with a modality-routing registry for extensibility
  • A MultiModalEmbedder with built-in support for text (via sentence-transformers) and image (via CLIP) embeddings
  • Lazy model loading and configurable batch processing

sdk/python/feast/doc_embedder.py

The high-level orchestrator that coordinates chunking, embedding, and storage. Provides:

  • A DocEmbedder class that runs the full pipeline: chunk -> embed -> logical layer -> write to online store
  • A user-defined logical layer function to map output to the FeatureView schema
  • Auto-generation of a default FeatureView if the user does not define their own (controlled by create_feature_view). This is a basic implementation intended as a starting point

sdk/python/feast/init.py

Updated to export DocEmbedder, LogicalLayerFn, BaseChunker, TextChunker, ChunkingConfig, BaseEmbedder, MultiModalEmbedder, and EmbeddingConfig as part of Feast's public API.

Which issue(s) this PR fixes:

Create DocEmbedder class along with RAGRetriever #5426

Misc


Open with Devin

@patelchaitany patelchaitany requested a review from a team as a code owner February 16, 2026 11:28
devin-ai-integration[bot]

This comment was marked as resolved.

devin-ai-integration[bot]

This comment was marked as resolved.

@patelchaitany
Copy link
Contributor Author

@ntkathole @jyejare can You pls review this PR and let me know if any changes is needed.

@patelchaitany patelchaitany changed the title feat: Created DocEmbedder class #5972 feat: Created DocEmbedder class Feb 16, 2026
devin-ai-integration[bot]

This comment was marked as resolved.

Copy link
Collaborator

@jyejare jyejare left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great Addition @patelchaitany , this is a milestone for Feast in RAG. Glad to see multiple types of data are being supported by Embedder.

Few comments and we should be good to go.

devin-ai-integration[bot]

This comment was marked as resolved.

@ntkathole
Copy link
Member

@patelchaitany filename typo - examples/rag-retriever/rag_feast_docebedder.ipynb should be rag_feast_docembedder.ipynb

devin-ai-integration[bot]

This comment was marked as resolved.

@patelchaitany patelchaitany force-pushed the fet-DocEmbedder branch 2 times, most recently from e00ee22 to ee663f5 Compare March 5, 2026 06:31
devin-ai-integration[bot]

This comment was marked as resolved.

devin-ai-integration[bot]

This comment was marked as resolved.

devin-ai-integration[bot]

This comment was marked as resolved.

@patelchaitany patelchaitany force-pushed the fet-DocEmbedder branch 2 times, most recently from 05ee154 to 510c54a Compare March 9, 2026 12:22
devin-ai-integration[bot]

This comment was marked as resolved.

…ng them into the FeatureView schema.

- Added BaseChunker and TextChunker classes for document chunking.
- Updated pyproject.toml to include sentence-transformers dependency.
- Created a new Jupyter notebook example for using the RAG retriever with document embedding.

Signed-off-by: Chaitany patel <[email protected]>
…ng them into the FeatureView schema.

- Added BaseChunker and TextChunker classes for document chunking.
- Updated pyproject.toml to include sentence-transformers dependency.
- Created a new Jupyter notebook example for using the RAG retriever with document embedding.

Signed-off-by: Chaitany patel <[email protected]>
devin-ai-integration[bot]

This comment was marked as resolved.

devin-ai-integration[bot]

This comment was marked as resolved.

Copy link
Contributor

@devin-ai-integration devin-ai-integration bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Devin Review found 1 new potential issue.

View 23 additional findings in Devin Review.

Open in Devin Review

Copy link
Member

@ntkathole ntkathole left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

@ntkathole ntkathole merged commit 0719c06 into feast-dev:master Mar 16, 2026
26 checks passed


@runtime_checkable
class LogicalLayerFn(Protocol):

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Probably we should rename this as it's not particularly intuitive IMO

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So i have two name in the mind - SchemaMapperFn or the FeatureViewMapperFn i think this two name are more intuitive if you have particular name in mind then let me know.

Anarion-zuo pushed a commit to Anarion-zuo/feast that referenced this pull request Mar 17, 2026
* - Introduced DocEmbedder class for embedding documents and transforming them into the FeatureView schema.
- Added BaseChunker and TextChunker classes for document chunking.
- Updated pyproject.toml to include sentence-transformers dependency.
- Created a new Jupyter notebook example for using the RAG retriever with document embedding.

Signed-off-by: Chaitany patel <[email protected]>

* - Introduced DocEmbedder class for embedding documents and transforming them into the FeatureView schema.
- Added BaseChunker and TextChunker classes for document chunking.
- Updated pyproject.toml to include sentence-transformers dependency.
- Created a new Jupyter notebook example for using the RAG retriever with document embedding.

Signed-off-by: Chaitany patel <[email protected]>

* resolving the merge conflict

Signed-off-by: Chaitany patel <[email protected]>

---------

Signed-off-by: Chaitany patel <[email protected]>
Signed-off-by: aaronzuo <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants