Directive Marker Recognizer (iai_mcp/directive_marker.py)

iai-personal-memory-engine · src/iai_mcp/directive_marker.py · python · MIT
automation, ai, dev-tools, lang:python, tag:regex

Recognizes and parses standing directive markers using pure lexical string matching. Reuse for deterministic command parsing in AI memory engines.

# Source: https://github.com/CodeAbra/iai-personal-memory-engine | License: MIT | Copyright 2026 Areg Noya
# Provided via justclaw.it.com; keep this notice with the code.
"""Pure-lexical typed-marker recognizers for capture-time standing orders.

Distinct from directive_classify.py's fuzzy phrasing signal: this module
recognizes two deterministic anchored prefixes -- "standing directive:" as
the sole evidence a human explicitly typed a standing order, and
"remove directive:" as the sole evidence a human wants one retired. Pure
string processing, no I/O, no import of capture/store/embed modules.

Every pattern anchored at the start (after leading whitespace), IGNORECASE,
no nested quantifiers (house ReDoS rule, mirrors directive_classify.py).
"""
from __future__ import annotations

import r

... (truncated -- full source via MCP)

See the full source, get the GitHub permalink, and search for more like it.

Get a free API key