memory-lean

v1.7.0
io.github.zamansheikh/memory-lean Checked 5 hours ago Published 9 days ago

Token-lean memory for AI agents: a knowledge graph searched cheaply.

These tools were reported by the server itself during our smoke test (tools/list), not copied from the README.

search_nodes

Find entities. Every term must appear in the name, type, an observation, or the type of a relation touching the entity (case-insensitive). Returns ranked names with matching snippets, at most 'limit' (default 10), then entities matching only in archived observations. open_nodes returns full entities.

ParameterTypeDescription
query *string
limitnumberMax results (default 10, max 50)

open_nodes

Return full entities by exact name, with every relation touching them. With related: true, related rules and pending work come first, each with its first fact.

ParameterTypeDescription
names *array
relatedboolean

read_graph

Index of the graph: entity names grouped by type, with observation counts. Does not return observations; use open_nodes for those. Large types come as a count unless entityType names one.

ParameterTypeDescription
entityTypestringOnly this type

create_entities

Create entities; existing names are skipped. Each observation is one fact on one line: aim for under 150 characters, over 300 is rejected.

ParameterTypeDescription
entities *array

create_relations

Create relations (active voice, e.g. depends_on, blocks, applies_to); duplicates are skipped.

ParameterTypeDescription
relations *array

add_observations

Add observations to existing entities. One fact each, on one line: aim for under 150 characters, over 300 is rejected. Replace a stale fact with replace_observation rather than appending a correction. Entities over 15 observations have their oldest dated ones moved to archive/.

ParameterTypeDescription
observations *array

replace_observation

Replace one observation of an entity in place. 'old' is its exact text, or a part of it (8+ characters) found in no other observation of the entity.

ParameterTypeDescription
entityName *string
old *string
text *stringThe new observation

archived_observations

List the observations of an entity that were moved to archive/, oldest first. Pass 'restore' with exact texts to move them back onto the entity.

ParameterTypeDescription
entityName *string
querystringOnly archived observations containing every term
restorearray

rename_entity

Rename an entity, keeping its observations and every relation touching it. Fails if the new name is taken.

ParameterTypeDescription
name *stringCurrent name
newName *string

delete_entities

Delete entities and every relation touching them.

ParameterTypeDescription
entityNames *array

delete_observations

Delete observations from entities, each named by its exact text or by a part of it (8+ characters) found in no other observation of the entity.

ParameterTypeDescription
deletions *array

delete_relations

Delete specific relations.

ParameterTypeDescription
relations *array