After uploading some documents to your collection, you can start querying them.
Below are some examples of how to do this using the ZeroEntropy SDK for Python and TypeScript.
In the examples/upload section, we uploaded a document with the text “My favorite apple is the Granny Smith.”.
Copy
from zeroentropy import ZeroEntropyzclient = ZeroEntropy()# Assume you have already added documents to the collection "default"response = zclient.queries.top_documents( collection_name="default", query="What is the best apple?", k=1,)print(response.results)
In the examples/upload section, we uploaded a document with two pages of text about apples and search.
Copy
from zeroentropy import ZeroEntropyz = ZeroEntropy()# Assume you have already added documents to the collection "pages"response = zclient.queries.top_pages( collection_name="pages", query="What is the best apple?", k=1, include_content=True,)print(response.results)
In the examples/upload section, we uploaded a pdf which was an arxiv paper about RAG evaluation in the “pdfs” collection.
The pdf was uploaded with the metadata "arxiv" and "research".
Copy
from zeroentropy import ZeroEntropyzclient = ZeroEntropy()# Assume you have already added documents to the collection "pdfs"response = zclient.queries.top_snippets( collection_name="pdfs", query="What is Retrieval Augemented Generation?", k=1, filter={ "list:tags": { "$in": ["arxiv"] } }, precise_responses=True, reranker="zerank-1", # Use our Reranker as a post-processing step)print(response.results)
For more information on metadata filtering, see the metadata filtering section.