Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Up the number of queried documents by Chroma #160

Merged
merged 1 commit into from
Nov 3, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 8 additions & 1 deletion ragna/source_storages/_chroma.py
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,14 @@ def retrieve(
# estimate how many sources we have to query. We overestimate by a
# factor of two to avoid retrieving to few sources and needed to query
# again.
int(num_tokens * 2 / chunk_size),
# ---
# FIXME: querying only a low number of documents can lead to not finding
# the most relevant one.
# See https://github.com/chroma-core/chroma/issues/1205 for details.
# Instead of just querying more documents here, we should use the
# appropriate index parameters when creating the collection. However,
# they are undocumented for now.
max(int(num_tokens * 2 / chunk_size), 100),
collection.count(),
),
include=["distances", "metadatas", "documents"],
Expand Down
Loading