microsoft/autogen · error · NotImplementedError
Error: {query.mime_type} is not supported. Only MemoryMimeTy
Error message
Error: {query.mime_type} is not supported. Only MemoryMimeType.TEXT, MemoryMimeType.JSON, MemoryMimeType.MARKDOWN are currently supported. What it means
On the semantic (non-sequential) query path, RedisMemory must turn the query into a string prompt for embedding. It accepts MemoryContent only with TEXT, MARKDOWN, or JSON mime types; anything else (IMAGE, BINARY) raises NotImplementedError listing the supported types.
Source
Thrown at python/packages/autogen-ext/src/autogen_ext/memory/redis/_redis_memory.py:316
raise ValueError(
"Non-sequential queries cannot be run with an underlying sequential RedisMemory. Set sequential=False in RedisMemoryConfig to enable semantic memory querying."
)
elif sequential or self.config.sequential:
results = self.message_history.get_recent(
top_k=top_k,
raw=False,
)
else:
# get the query string, or raise an error for unsupported MemoryContent types
if isinstance(query, str):
prompt = query
elif isinstance(query, MemoryContent):
if query.mime_type in (MemoryMimeType.TEXT, MemoryMimeType.MARKDOWN):
prompt = str(query.content)
elif query.mime_type == MemoryMimeType.JSON:
prompt = serialize(query.content)
else:
raise NotImplementedError(
f"Error: {query.mime_type} is not supported. Only MemoryMimeType.TEXT, MemoryMimeType.JSON, MemoryMimeType.MARKDOWN are currently supported."
)
else:
raise TypeError("'query' must be either a string or MemoryContent")
results = self.message_history.get_relevant( # type: ignore
prompt=prompt, # type: ignore[reportArgumentType]
top_k=top_k,
distance_threshold=distance_threshold,
raw=False,
)
memories: List[MemoryContent] = []
for result in results: # type: ignore[reportUnkownVariableType]
metadata = deserialize(result["metadata"]) # type: ignore[reportArgumentType]
mime_type = MemoryMimeType(metadata.pop("mime_type"))
if mime_type in (MemoryMimeType.TEXT, MemoryMimeType.MARKDOWN):
memory_content = result["content"] # type: ignore[reportArgumentType]View on GitHub (pinned to 027ecf0a37)
Solutions
- Query with a plain string or a TEXT/MARKDOWN/JSON MemoryContent containing the text to embed.
- For image-based retrieval, first produce a textual description and use that as the query.
- Centralize a to_query_text() helper so all query inputs are normalized to strings.
Example fix
# before
result = await memory.query(MemoryContent(content=img, mime_type=MemoryMimeType.IMAGE)) # NotImplementedError
# after
result = await memory.query('notes about the architecture diagram') Defensive patterns
Strategy: type-guard
Validate before calling
from autogen_core.memory import MemoryContent, MemoryMimeType
QUERYABLE = (MemoryMimeType.TEXT, MemoryMimeType.MARKDOWN, MemoryMimeType.JSON)
def query_ok(q) -> bool:
return isinstance(q, str) or (isinstance(q, MemoryContent) and q.mime_type in QUERYABLE) Type guard
def is_queryable_content(q) -> bool:
return isinstance(q, MemoryContent) and q.mime_type in (MemoryMimeType.TEXT, MemoryMimeType.MARKDOWN, MemoryMimeType.JSON) Try / catch
try:
res = await memory.query(q)
except NotImplementedError as e:
raise ValueError(f'convert query to text first: {e}') from e Prevention
- Normalize all queries to str at your boundary
- Never pass Image/binary MemoryContent as a semantic query
- Wrap query construction in one helper with the mime allowlist
When it happens
Trigger: await redis_memory.query(MemoryContent(content=Image(...), mime_type=MemoryMimeType.IMAGE)) on a sequential=False memory; querying with a binary MemoryContent; passing a custom mime enum value.
Common situations: Passing the agent's last multimodal message directly as the query; building query MemoryContent from uploaded files without converting to text; mixing sequential and semantic code paths where the sequential path never validates mime type.
Related errors
- Error: {content.mime_type} is not supported. Only MemoryMime
- Unsupported content type: {mime_type}
- Unsupported content type: {mime_type}
- Non-sequential queries cannot be run with an underlying sequ
- 'query' must be either a string or MemoryContent
AI-assisted analysis of microsoft/autogen@027ecf0a37 (2026-08-15).
Data as JSON: /api/errors/bb85298c4b74f697.
Report an issue: GitHub.