[BUG] Qdrant metadata content overwrites the indexed document body
I maintainer di solito rispondono entro 1 giorno
Valutazione
- Difficoltà
- 1/5
- Tempo stimato
- Meno di un'ora
- Idoneità per principianti
- 25/100
Direzione di ricerca
Start at crewai/rag/qdrant/client.py and read _create_point_from_document, which the issue identifies as the shared payload helper for sync and async adds. The issue reports an open linked pull request (#9130) with regression tests already prepared. Done means the stored and returned document body remains the original text while non-conflicting metadata remains available.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
Description
Qdrant document metadata containing a content key silently replaces the document text in the stored payload. The embedding is computed from document["content"], but search returns metadata["content"] as the document body. Both add_documents and aadd_documents use the same payload helper.
Reproduction
Reproduced on main at 6bd60b223101a11f7ac675706ff1ebb03314c95d (CrewAI 1.15.35), Windows, Python 3.12.15, qdrant-client 1.14.3. No server, model, or API key is needed:
from crewai.rag.qdrant.client import QdrantClient
from qdrant_client import QdrantClient as SDKClient
from qdrant_client.models import Distance, VectorParams
sdk = SDKClient(location=":memory:")
try:
client = QdrantClient(client=sdk, embedding_function=lambda text: [1.0, 0.0, 0.0])
client.create_collection(
collection_name="content_repro",
vectors_config=VectorParams(size=3, distance=Distance.COSINE),
)
client.add_documents(collection_name="content_repro", documents=[{
"content": "Original document text",
"metadata": {"content": "Metadata text", "source": "example.txt"},
}])
result = client.search(collection_name="content_repro", query="Original document text")[0]
print(result["content"])
assert result["content"] == "Original document text", result
finally:
sdk.close()
Actual: prints Metadata text and fails the assertion. The equivalent async create/add/search sequence returns the same wrong text.
Expected: the canonical document body remains Original document text. Non-conflicting metadata such as source remains available.
Cause and proposed fix
_create_point_from_document builds {"content": doc["content"], **metadata}, so metadata wins on collision. Assigning the reserved payload content field after expanding metadata preserves the document body. This keeps the existing flat payload layout and metadata filtering behavior; it does not introduce a new metadata storage format or recover previously overwritten content.
I checked existing issues and open PRs for this collision and did not find a duplicate. A one-line fix and regression tests for mapping/list metadata and empty/nonempty text are ready. The four new cases fail before the fix; the full Qdrant test module passes (47 tests) after it. Real in-memory sync/async roundtrips were also checked.
AI disclosure
AI-generated contribution: the investigation, reproduction, proposed implementation, tests, and this report were prepared and run with an AI coding assistant at the contributor's request. Please apply the required llm-generated label if my account cannot manage repository labels.
- Lingua principale
- Python
- Stelle
- 60.6k
- Fork
- 9.1k
- Merge medio
- 1g 2h
- PR unite (30g)
- 214
Preparare l'ambiente
- Nessun Dockerfile né file Docker Compose
- Ha un modello di pull request
- Leggi la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di crewAIInc/crewAI
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 66/100
I maintainer di solito rispondono entro 1 giorno
-
Feature request: GoldenDirectiveTool (harmonic relationship score, full vs cropped reporting)Apertafeature-request
Difficoltà 2/5 1-3 ore Idoneità per principianti 66/100
crewAIInc/crewAI#9200 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
crewAIInc/crewAI#9132 · 5 commenti ·
I maintainer di solito rispondono entro 1 giorno
-
[BUG] Scrape tools reject the documented cookies mapping and drop cookies when the URL is passed at runtimeForse già presa @Luckyou-d l’ha presa 5 giorni fa. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
I maintainer di solito rispondono entro 1 giorno
-
[BUG] OpenAI-compatible embedding model alias breaks embedder constructionForse già presa @gokay-ai l’ha presa 11 giorni fa. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 65/100
crewAIInc/crewAI#8761 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
Tutte le issue di crewAIInc/crewAI
Issue simili
-
`destroy` sans terminal répond « Aborted. » au lieu de réclamer `--yes` comme `clean` et `reset`Apertabug
Difficoltà 2/5 1-3 ore Idoneità per principianti 85/100
stephrobert/dsoxlab#354 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 77/100
jasonacox/pypowerwall#472 ·
I maintainer di solito rispondono entro 1 giorno
-
[Bug]: DoubleMLRDDData accepts a score_col that is no data column (as in its docstring example); the running variable then becomes a covariate and RDFlex failsForse già presa @vrjdev l’ha presa oggi. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
DoubleML/doubleml-for-py#455 ·
I maintainer di solito rispondono entro 1 giorno
-
[Bug]: Python mod.Box[T] annotation gets a false generic_arg edge that replaces the parameter_type one ('is' on tree-sitter nodes)Forse già presa @rohit-jsfreaky l’ha presa oggi. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 88/100
Graphify-Labs/graphify#5110 · 1 commento ·
I maintainer di solito rispondono entro 2 giorni
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
assafelovic/gpt-researcher#2277 ·
I maintainer di solito rispondono entro 10 giorni