Files
python-sdk/pkg
zeekay 27bf1ef5bb brain: port graph-links + recipes to hanzo-memory (Python parity with bot/extensions)
Adds the zero-LLM typed-link extractor + YAML recipe loader to the
existing hanzo-memory Python SDK so a single brain.db file can be
written by the TS bot and read by the Python SDK and vice versa.

  graph_links.py — Edge dataclass, extract_edges(), reconcile(),
                   slugify(). Same six edge types
                   (mentions/attended/works_at/invested_in/founded/
                   advises), same regex + role inference, same code-
                   fence stripping. Pure — no I/O, no LLM.

  recipes.py     — list_recipes() + load_recipe(name). Reads built-in
                   recipes/ dir + optional HANZO_BRAIN_RECIPES path.

  recipes/email.yaml — flagship swipe-to-reply recipe, byte-identical
                       to the TS pack so cross-runtime brains agree.

  tests/test_graph_links.py — mirror of TS suite. 12 assertions cover
                              slugify, every edge type, code-fence
                              stripping, dedup, bare slugs, reconcile,
                              and recipe load.

hanzo-memory already had pluggable backends (SQLite + sqlite-vec via
.db.factory) and an MCP server; this fills in the gbrain-shape graph +
recipe surfaces so the Python SDK reaches feature parity with the bot
extensions in TS.
2026-05-10 18:39:39 -07:00
..
2026-03-23 10:26:07 -07:00