Description

Get memory at path

Reads one exact memory entry by hierarchical path (e.g. user/preferences/color).

Included in Version 7

Dynamically extracted tool implementation.
How to register BuiltInToolscsharp
registry.Register(new AgentTool(            "get_memory_at_path",            "Reads one exact memory entry by hierarchical path (e.g. user/preferences/color).",            args => {                if (registry.Memory is null) return "Error: Memory system is not initialized.";                try {                    using var doc = JsonDocument.Parse(args);                    var root = doc.RootElement;                    if (!root.TryGetProperty("path", out var pathProp)) {                        return "Error: Missing path property.";                    }                    string path = pathProp.GetString() ?? "";                    if (string.IsNullOrWhiteSpace(path)) return "Error: Path cannot be empty.";                    string? value = registry.Memory.QueryPath(path);                    if (value is null) return $"No memory found at path '{path}'.";                    return value;                }                catch (Exception ex) {                    return $"Error: {ex.Message}";                }            },            new {                type = "object",                properties = new {                    path = new { type = "string", description = "Exact memory path, e.g. 'user/job' or 'user/preferences/color'." }                },                required = new[] { "path" }            }        ));