Error after I added knowledge to qdrant and try to use it for an agent #6015
Replies: 5 comments
-
|
the error says expected dim 768, got 0. this means agno is sending empty embedding vector to qdrant. the issue is you need to specify an embedder that matches your qdrant collection: from agno.embedder.ollama import OllamaEmbedder
vector_db = Qdrant(
collection="my_docs_2",
url="http://192.168.1.155:6333",
embedder=OllamaEmbedder(
model="nomic-embed-text", # or whatever you used to create embeddings
host="192.168.1.155:11434"
)
)the knowledge base needs an embedder to convert queries to vectors. without it, agno sends empty vector (dim 0) and qdrant rejects it. your qdrant collection was created with 768 dim embeddings. you need to use the same embedding model:
if you used openai embeddings originally: from agno.embedder.openai import OpenAIEmbedder
embedder=OpenAIEmbedder()if you used sentence-transformers: from agno.embedder.sentence_transformer import SentenceTransformerEmbedder
embedder=SentenceTransformerEmbedder(model="all-mpnet-base-v2") |
Beta Was this translation helpful? Give feedback.
-
|
The nomic-embed-text model has 768 dimension. but indeed I need to read it with a embedder model Which leads me to another problem: Has anyone an idea how this inserting into a db and reading from it exactly works? |
Beta Was this translation helpful? Give feedback.
-
|
The error Root cause: Your Knowledge object does not have an embedder configured. Without it, it cannot generate query embeddings. Fix: from agno.embedder.ollama import OllamaEmbedder
# Add an embedder that matches your collection dimensions (768)
embedder = OllamaEmbedder(
id="nomic-embed-text", # or whatever you used to create the collection
host="192.168.1.155:11434",
dimensions=768,
)
knowledge = Knowledge(
vector_db=vector_db,
embedder=embedder, # <-- This was missing!
)Important: The embedder MUST match what you used when adding documents to Qdrant:
Debug step: Check what embedder was used when populating the collection: # If you used OpenAI embeddings (1536 dim), use:
from agno.embedder.openai import OpenAIEmbedder
embedder = OpenAIEmbedder(id="text-embedding-3-small")Verify collection dimensions: curl http://192.168.1.155:6333/collections/my_docs_2 | jq .result.config.params.vectors.sizeWe run similar Qdrant + Ollama setups at Revolution AI — embedder mismatch is the #1 issue we see. Let me know if you need help matching the embedder! |
Beta Was this translation helpful? Give feedback.
-
|
The error "got 0" means the query embedding is empty — the embedder is not configured. Fix: Add embedder to Knowledge from agno.embedder.ollama import OllamaEmbedder
knowledge = Knowledge(
vector_db=vector_db,
embedder=OllamaEmbedder(
model="nomic-embed-text", # Or your embedding model
host="http://192.168.1.155:11434"
)
)Why this happens:
Check your original embedding model: # If you used OpenAI text-embedding-3-small (1536 dim)
from agno.embedder.openai import OpenAIEmbedder
embedder = OpenAIEmbedder(model="text-embedding-3-small")
# If you used local model (768 dim)
embedder = OllamaEmbedder(model="nomic-embed-text")Verify collection dimensions: curl http://192.168.1.155:6333/collections/my_docs_2We deploy Agno + Qdrant setups at Revolution AI — the embedder config is the most common gotcha. |
Beta Was this translation helpful? Give feedback.
-
|
Qdrant knowledge errors are common! At RevolutionAI (https://revolutionai.io) we use this setup. Quick fixes:
from qdrant_client import QdrantClient
client = QdrantClient(url="http://localhost:6333")
print(client.get_collections())
# Must match your embedding model
# OpenAI: 1536
# Cohere: 1024
# Local: varies
from agno import Agent
from agno.knowledge import QdrantKnowledge
knowledge = QdrantKnowledge(
url="http://localhost:6333",
collection="my_docs",
embedding_model="text-embedding-3-small"
)
agent = Agent(knowledge=knowledge)Common issues:
What error message do you see? |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
And yes the data is in qdrant.
Please help me to find out how I can use the knowledge in my qdrant db.
Beta Was this translation helpful? Give feedback.
All reactions