Severusll opened a new issue, #1394:
URL: https://github.com/apache/flink-agents/issues/1394

   ### Search before asking
   
   - [x] I searched in the 
[issues](https://github.com/apache/flink-agents/issues) and found nothing 
similar.
   
   ### Description
   
   The public `BaseVectorStore.get` contract states that when `ids` is 
supplied, the ID selection bounds the result and `limit` is effectively ignored.
   
   The Python Chroma adapter always forwards `limit`, including the default of 
100. Consequently, requesting 101 existing IDs returns 100 documents. 
Requesting two existing IDs with `limit=1` returns one document. Supplying 
`limit=None` returns all requested documents.
   
   This can silently omit explicitly requested documents during batch reads. A 
scan without IDs should continue to respect its limit.
   
   I would like to work on this fix and have prepared a local patch with 
regression tests. The proposed scope is to ignore the scan limit when IDs are 
supplied, while retaining filtering and bounded scans. Could a committer 
confirm whether this approach is appropriate? Please assign the issue to me if 
that fits the project's workflow.
   
   Related code
   
   - [BaseVectorStore.get 
contract](https://github.com/apache/flink-agents/blob/5b0b5531657aacb050201056ebc717fc8e683f09/python/flink_agents/api/vector_stores/vector_store.py#L354)
   - 
[ChromaVectorStore.get](https://github.com/apache/flink-agents/blob/5b0b5531657aacb050201056ebc717fc8e683f09/python/flink_agents/integrations/vector_stores/chroma/chroma_vector_store.py#L234)
   
   ### How to reproduce
   
   Use the current source checkout with its Python package on PYTHONPATH and 
the declared Chroma dependency installed.
   
   `from flink_agents.api.vector_stores.vector_store import Document
   from flink_agents.integrations.vector_stores.chroma.chroma_vector_store 
import (
       ChromaVectorStore,
   )
   
   store = ChromaVectorStore(
       name="explicit_ids_probe",
       embedding_model="unused",
       collection="explicit_ids_probe",
   )
   ids = [str(i) for i in range(101)]
   store.add([
       Document(
           id=doc_id,
           content="sample",
           metadata={"category": "a"},
           embedding=[1.0, 0.0],
       )
       for doc_id in ids
   ])
   
   print(len(store.get(ids=ids, limit=None)))   # 101
   print(len(store.get(ids=ids)))               # actual 100, expected 101
   print(len(store.get(ids=ids[:2], limit=1)))  # actual 1, expected 2
   print(len(store.get(limit=1)))               # 1, expected 1`
   
   The adapter uses a local ephemeral Chroma client. The vectors are 
precomputed, so this reproduction requires no embedding service or LLM.
   
   ### Version and environment
   
   - Apache Flink Agents main at `5b0b5531657aacb050201056ebc717fc8e683f09`
   - Windows, Python 3.12.1
   - ChromaDB 1.0.21
   - Pydantic 2.12.5
   - Reproduced through the adapter directly without a Flink cluster
   
   ### Are you willing to submit a PR?
   
   - [x] I'm willing to submit a PR!


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to