feat: Making feast vector store with open ai search api compatible#6121
feat: Making feast vector store with open ai search api compatible#6121patelchaitany wants to merge 3 commits into
Conversation
e45f167 to
c8392a9
Compare
7e8adfb to
3f541ad
Compare
cd692b9 to
086bed5
Compare
086bed5 to
9778002
Compare
68c843c to
e29e557
Compare
f0552c7 to
dafe9fd
Compare
639bada to
c879c9e
Compare
| ``vector_store_id`` path parameter). | ||
| query: Natural language query string, or list of strings. | ||
| max_num_results: Maximum number of results to return. | ||
| filters: OpenAI-compatible filters (accepted but not yet |
There was a problem hiding this comment.
filters are accepted and applied as well
| value: Union[str, int, float, bool, List[Union[str, int]]] | ||
|
|
||
|
|
||
| class OpenAICompoundFilter(BaseModel): |
There was a problem hiding this comment.
I think these all are not needed now, it's duplicate of filter_models.py definitions
| ... | ||
|
|
||
|
|
||
| class LiteLLMEmbeddingProvider: |
There was a problem hiding this comment.
| class LiteLLMEmbeddingProvider: | |
| class LiteLLMEmbeddingProvider(EmbeddingProvider): |
| "/v1/vector_stores/{vector_store_id}/search" | ||
| ): | ||
| try: | ||
| result = await run_in_threadpool( |
There was a problem hiding this comment.
The entire call including the embedding network I/O is wrapped in run_in_threadpool, which blocks a thread waiting for the OpenAI/Ollama HTTP response. LiteLLMEmbeddingProvider.aembed() exists precisely to avoid this. Make retrieve_online_documents_openai async, call await self.embedding_provider.aembed(...) inside it, and then await run_in_threadpool only for the DB retrieval step. The endpoint can then await store.retrieve_online_documents_openai(...) directly without an outer run_in_threadpool.
There was a problem hiding this comment.
Done. retrieve_online_documents_openai is now async with await aembed(...). The retrieve_online_documents_v2 call is still in run_in_threadpool since it has no async variant.
| query=request.query, | ||
| max_num_results=request.max_num_results or 10, | ||
| filters=( | ||
| request.filters.model_dump() if request.filters else None |
There was a problem hiding this comment.
request.filters.model_dump() can be removed once line 146 uses ComparisonFilter/CompoundFilter directly
e7ba622 to
502286f
Compare
| --- | ||
| title: "Making Feast Speak OpenAI: Vector Search Without the Glue Code" | ||
| description: "Feast now exposes an OpenAI-compatible vector store search endpoint. Send a plain text query, get results back in the standard OpenAI format. No client-side embeddings required." | ||
| date: 2026-04-28 |
|
Also add documentation for OpenAI-compatible Vector search endpoint in docs/reference/alpha-vector-database.md and docs/reference/feature-servers/python-feature-server.md Also, missing docs for how user can use different embedding provider other than litellm |
502286f to
925eb2e
Compare
925eb2e to
c2782f5
Compare
ntkathole
left a comment
There was a problem hiding this comment.
looks good to me!
@franciscojavierarceo will you be able to take a look once?
|
@ntkathole, The CI for the mcp-feature-server-runtime was failing because fastapi_mcp does not handle circular references properly. To fix this, I made changes in mcp_server.py where we inserted a custom schema resolver that handles how reference schemas are resolved. I also verified its logic against the original fastapi_mcp logic -- both produce the same output when there are no self-referencing schemas. |
58dcb47 to
ba5ad00
Compare
ba5ad00 to
180d80f
Compare
Signed-off-by: Chaitany patel <patelchaitany93@gmail.com>
Signed-off-by: Chaitany patel <patelchaitany93@gmail.com>
…gistration fastapi_mcp 0.4.0 resolve_schema_references() has no cycle detection. Feast's OpenAPI schema contains self-referential protobuf types (Value -> Struct -> Value) which trigger a RecursionError. The error is silently caught, so the /mcp route never gets registered and CI gets a 404. Add _resolve_schema_references_safe() that tracks a seen-refs set to break circular chains, and monkey-patch it into fastapi_mcp before FastApiMCP processes the schema. Non-circular schemas produce identical output to the original. Signed-off-by: Chaitany patel <patelchaitany93@gmail.com>
What this PR does / why we need it:
This PR making the feast vector store api with open ai search api compatible so.
This are the changes are made.
POST /v1/vector_stores/{vector_store_id}/searchthat matches the OpenAI vector store search APIvector_store_idjust maps to a feature view nameretrieve_online_documents_v2, and returns results in OpenAI'svector_store.search_results.pageformatfeature_store.yamlunder a newembedding_modelsection (model, api_key, api_base, api_version, dimensionsfilter_models.pywith two Pydantic models:ComparisonFilter(eq, ne, gt, gte, lt, lte, in, nin) andCompoundFilter(and/or, nestable)field == 'value'entity_key IN (SELECT ...)enable_openai_compatible_storeconfig flag on every store backendvalue_numcolumn that stores int, float, double, and bool values natively alongside the existing `value_textvalueinstead ofvalue_textqueryparam renamed toembeddingsince that's what it actually isWhich issue(s) this PR fixes:
#5615
Misc