Geospatial operations and NAMS behavior
Location search/geocoding, context assembly, and the NAMS wrapper differences for LongTermMemory API reference. Signatures show types, keyword-only arguments (*), and defaults; they are reference declarations, not calls to execute directly.
Geospatial operations (bolt only)
search_locations_near
Find Location entities within a radius of a point.
async def search_locations_near(
latitude: float,
longitude: float,
*,
radius_km: float=10.0,
session_id: str | None=None,
limit: int=10,
) -> list[Entity]: ...
| Parameter | Description |
|---|---|
|
Latitude of the center point |
|
Longitude of the center point |
|
Search radius in kilometers (default 10km) |
|
Optional session ID to filter locations by conversation |
|
Maximum number of results |
search_locations_in_bounding_box
Find Location entities within a bounding box.
async def search_locations_in_bounding_box(
min_lat: float,
min_lon: float,
max_lat: float,
max_lon: float,
*,
session_id: str | None=None,
limit: int=100,
) -> list[Entity]: ...
| Parameter | Description |
|---|---|
|
Minimum latitude (south) |
|
Minimum longitude (west) |
|
Maximum latitude (north) |
|
Maximum longitude (east) |
|
Optional session ID to filter locations by conversation |
|
Maximum number of results |
get_location_coordinates
Get coordinates for a Location entity.
async def get_location_coordinates(entity_id: UUID | str) -> tuple[float, float] | None: ...
| Parameter | Description |
|---|---|
|
Entity ID |
geocode_locations
Batch geocode location entities without coordinates. Returns only processed and geocoded counts; without a configured geocoder both counts are zero.
async def geocode_locations(
*,
batch_size: int=50,
skip_existing: bool=True,
on_progress: Callable[[int, int], None] | None=None,
) -> dict[str, int]: ...
| Parameter | Description |
|---|---|
|
Number of locations to process per batch |
|
Skip locations that already have coordinates |
|
Progress callback (processed_count, total_count) |
Although skip_existing is accepted, the current query always selects locations without coordinates. Passing False does not refresh previously geocoded locations.
NAMS behavior
NAMS manages extraction and resolution on the server. These are the client wrapper differences, not service versions or pricing tiers.
| Operation | Hosted behavior |
|---|---|
|
Returns one |
|
Sends query, limit, and a single type via |
|
Searches up to 20 results and returns the first exact case-sensitive name match, or None. |
|
Returns identifying relationship dictionaries ( |
|
Takes an entity id (not a name) and returns |
|
Returns an empty string. Use entity search and conversation context explicitly. |
|
Raise |
|
Bolt-only methods; not defined on |
# NAMS: retain the entity directly; no tuple unpacking.
entity = await client.long_term.add_entity("Acme Corp", "ORGANIZATION")
wait_for_extraction
Wait for asynchronous extraction. Pass a conversation ID for pipeline status and optionally expected_names or predicate for entity confirmation. Returns False on timeout; check the result. A query with min_results=1 alone can match unrelated existing workspace entities. On bolt, this method is a no-op returning True.
async def wait_for_extraction(
*,
query: str | None=None,
expected_names: list[str] | None=None,
min_results: int=1,
predicate: Callable[[list[Entity]], bool] | None=None,
timeout: float=30.0,
interval: float=1.0,
session_id: str | None=None,
**kwargs: Any,
) -> bool: ...
expand_graph
NAMS only. Return one-hop graph expansion as a dictionary with nodes and edges, excluding supplied loaded_ids.
async def expand_graph(node_id: str, *, loaded_ids: list[str] | None=None) -> dict[str, list[dict[str, Any]]]: ...
get_entity_provenance (NAMS)
NAMS: return the entity reasoning provenance dictionary from the reasoning endpoint. Its server shape differs from bolt message/extractor provenance.
async def get_entity_provenance(entity_id: UUID | str) -> dict[str, Any]: ...
set_entity_feedback
NAMS only. positive maps to userScore 1.0 and confirmed True; negative maps to 0.0 and False; a numeric string maps to userScore. Explicit user_score and confirmed kwargs override this mapping. This does not store an arbitrary feedback comment.
async def set_entity_feedback(entity_id: UUID | str, feedback: str, **kwargs: Any) -> None: ...