microsoft/semantic-kernel · error · NotImplementedError
Get without keys is not yet implemented.
Error message
Get without keys is not yet implemented.
What it means
Thrown by _inner_get (in_memory.py:626-627) as NotImplementedError when collection.get() is called with GetFilteredRecordOptions but no keys. The in-memory store supports keyed reads and vector search, but not a filtered scan via get(); the guard makes the gap explicit rather than silently returning None.
Source
Thrown at python/semantic_kernel/connectors/in_memory.py:627
def _validate_data_model(self):
"""Check if the In Memory Score key is not used."""
super()._validate_data_model()
if IN_MEMORY_SCORE_KEY in self.definition.names:
raise VectorStoreModelValidationError(f"Field name '{IN_MEMORY_SCORE_KEY}' is reserved for internal use.")
@override
async def _inner_delete(self, keys: Sequence[TKey], **kwargs: Any) -> None:
for key in keys:
self.inner_storage.pop(key, None)
@override
async def _inner_get(
self, keys: Sequence[TKey] | None = None, options: GetFilteredRecordOptions | None = None, **kwargs: Any
) -> Any | OneOrMany[TModel] | None:
if not keys:
if options is not None:
raise NotImplementedError("Get without keys is not yet implemented.")
return None
return [self.inner_storage[key] for key in keys if key in self.inner_storage]
@override
async def _inner_upsert(self, records: Sequence[Any], **kwargs: Any) -> Sequence[TKey]:
updated_keys = []
for record in records:
record = AttributeDict(record)
self.inner_storage[record[self._key_field_name]] = record
updated_keys.append(record[self._key_field_name])
return updated_keys
def _deserialize_store_models_to_dicts(self, records: Sequence[Any], **kwargs: Any) -> Sequence[dict[str, Any]]:
return records
def _serialize_dicts_to_store_models(self, records: Sequence[dict[str, Any]], **kwargs: Any) -> Sequence[Any]:
return records
View on GitHub (pinned to c028a0c7dc)
Solutions
- Pass explicit keys to collection.get(): `await collection.get(keys=[...])`.
- For filtered retrieval, use vector/filtered search or iterate collection.inner_storage directly in tests.
- If you only need all records, read inner_storage or upsert+search.
Example fix
# before opts = GetFilteredRecordOptions(...) rows = await collection.get(options=opts) # no keys -> NotImplementedError # after rows = await collection.get(keys=[1, 2, 3])
Defensive patterns
Strategy: validation
Validate before calling
async def safe_get(collection, keys=None, options=None):
if not keys and options is not None:
raise ValueError("InMemoryCollection.get does not support filtered reads; pass keys")
return await collection.get(keys=keys, options=options) Try / catch
try:
rows = await collection.get(options=opts)
except NotImplementedError:
# fall back to keyed reads or a search-based retrieval
rows = await collection.get(keys=known_keys) Prevention
- Always pass keys to InMemoryCollection.get().
- Use search(), not get(), for filtered retrieval.
- Guard generic layers that auto-attach GetFilteredRecordOptions.
When it happens
Trigger: Calling `await collection.get(options=GetFilteredRecordOptions(...))` (or any get with options but an empty/None keys argument).
Common situations: Porting code from another store that supports filtered get(); assuming get() mirrors search() semantics; passing options by default from a generic layer.
Related errors
- Attribute '{node.func.attr}' is not callable in filter expre
- Field name '{IN_MEMORY_SCORE_KEY}' is reserved for internal
- Unable to get channel keys. Channel type not configured.
- Unable to create channel. Channel type not configured.
- The AutoGenConversableAgent does not support streaming.
AI-assisted analysis of microsoft/semantic-kernel@c028a0c7dc (2026-08-13).
Data as JSON: /api/errors/c91bdee3c8c86912.
Report an issue: GitHub.