What would you like to happen?
QdrantWriteConfig (added in #38142) currently stores only item.metadata as the point payload; item.content (the chunk text) is not written anywhere:
https://github.com/apache/beam/blob/master/sdks/python/apache_beam/ml/rag/ingestion/qdrant.py
return models.PointStruct(
id=id,
vector=vector,
payload=item.metadata if item.metadata else None,
)
The other RAG writers do persist the content: BigQueryVectorWriterConfig writes a content column (item.content_string) and the Milvus writer has with_content_spec(). With Qdrant, a search over a collection written by Beam returns vectors and metadata but not the text, so the retrieved chunks cannot be used for generation without a second lookup against the original source.
Proposal
Add an optional field to QdrantWriteConfig:
content_payload_key: Optional[str] = None
- Default
None keeps today's behavior exactly (no change for existing users).
- When set, the converter stores
item.content_string under that key in the payload, alongside the metadata. A collision with an existing metadata key should raise a clear ValueError rather than silently overwrite.
- Unit tests for the converter plus an update to the existing testcontainers round-trip test.
Questions for maintainers
- Was omitting the content intentional (e.g. to keep payloads small)? The existing tests assert
payload == item.metadata, so I want to make sure this is not a deliberate design decision before changing it.
- Is an opt-in
content_payload_key the right shape, or would you prefer a different name/default (e.g. always writing to a "content" key)?
Context
I plan to follow up with a Qdrant search enrichment handler (the earlier attempt in #35686 went stale), and the retrieved text is needed for that to be useful end to end. I would like to send this smaller change first, and I'm happy to take it on if the direction looks good.
Issue Priority
Priority: 3 (nice-to-have improvement)
Issue Components
What would you like to happen?
QdrantWriteConfig(added in #38142) currently stores onlyitem.metadataas the point payload;item.content(the chunk text) is not written anywhere:https://github.com/apache/beam/blob/master/sdks/python/apache_beam/ml/rag/ingestion/qdrant.py
The other RAG writers do persist the content:
BigQueryVectorWriterConfigwrites acontentcolumn (item.content_string) and the Milvus writer haswith_content_spec(). With Qdrant, a search over a collection written by Beam returns vectors and metadata but not the text, so the retrieved chunks cannot be used for generation without a second lookup against the original source.Proposal
Add an optional field to
QdrantWriteConfig:Nonekeeps today's behavior exactly (no change for existing users).item.content_stringunder that key in the payload, alongside the metadata. A collision with an existing metadata key should raise a clearValueErrorrather than silently overwrite.Questions for maintainers
payload == item.metadata, so I want to make sure this is not a deliberate design decision before changing it.content_payload_keythe right shape, or would you prefer a different name/default (e.g. always writing to a"content"key)?Context
I plan to follow up with a Qdrant search enrichment handler (the earlier attempt in #35686 went stale), and the retrieved text is needed for that to be useful end to end. I would like to send this smaller change first, and I'm happy to take it on if the direction looks good.
Issue Priority
Priority: 3 (nice-to-have improvement)
Issue Components