Skip to content

Conversation

@sicoyle
Copy link
Collaborator

@sicoyle sicoyle commented Aug 1, 2025

a user on discord mentioned having an issue with numpy here: https://discord.com/channels/778680217417809931/1349393513351217242/1400377086627287050

Logs from user:
https://gist.github.com/pklewing/d1251f274990a22f793e922709f34ad4

The user encountered the error because they had NumPy 2.2.6 installed, but PyTorch and sentence-transformers were compiled with NumPy 1.x, creating a compatibility mismatch where NumPy 2.x modules couldn't run with packages built for NumPy 1.x.

Specifying torch>=2.7.0 in our vectorstore dependencies fixes this because PyTorch 2.7+ was specifically updated to support both NumPy 1.x and 2.x, so it can handle either version without compatibility issues, whereas the previous approach of letting sentence-transformers pull in an older PyTorch version would still cause the NumPy 2.x compatibility error.


python 05_agent_with_vectorstore.py

INFO:dapr_agents.document.embedder.sentence:Downloading SentenceTransformer model: all-MiniLM-L6-v2
INFO:sentence_transformers.SentenceTransformer:Load pretrained SentenceTransformer: all-MiniLM-L6-v2
INFO:dapr_agents.document.embedder.sentence:Model loaded successfully.
INFO:dapr_agents.storage.vectorstores.chroma:ChromaVectorStore initialized with collection: demo_vectorstore
WARNING:dapr_agents.tool.utils.tool:No type hints provided for function 'add_machine_learning_doc'. Defaulting to 'str'.
INFO:root:Seeding vector store with initial documents...
INFO:dapr_agents.document.embedder.sentence:Generating embeddings for 3 input(s).
Batches: 100%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 1/1 [00:00<00:00,  7.78it/s]
INFO:root:Seeded 3 initial documents.
INFO:root:Document IDs: ['8d16ceff-5f0f-45e5-96bb-e24bbc1908f0', '4c2c1698-3d6e-4117-8a95-04979b87fd3b', '1bc68503-d457-4e1c-bdc4-5155a1cbe3cd']
INFO:dapr_agents.llm.openai.client.base:Initializing OpenAI client...
INFO:dapr_agents.tool.executor:Tool registered: SearchDocuments
INFO:dapr_agents.tool.executor:Tool registered: AddDocument
INFO:dapr_agents.tool.executor:Tool registered: AddMachineLearningDoc
INFO:dapr_agents.tool.executor:Tool Executor initialized with 3 tool(s).
INFO:root:Starting Vector Database Agent...
user:
Add a machine learning basics document

--------------------------------------------------------------------------------
...

Signed-off-by: Samantha Coyle <sam@diagrid.io>
@yaron2 yaron2 merged commit 0a0dd31 into dapr:main Aug 1, 2025
6 checks passed
@sicoyle sicoyle deleted the fix-numpy-user-err branch August 1, 2025 15:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants