feat: memory_store + profiles_store + 10 new yaml entries (119 → 129)
Mirrors `long_term_memory` and `profiles` modules from rust fork.
memory_store.py (new, ~95 lines)
- JSON store at <here>/long_term_memory.json (atomic write).
- remember(key, value) / recall(key) / forget(key) / search(query, limit) /
all_facts() / build_llm_context(prompt, limit).
- Uses the same JSON shape as the rust side, so the file is
interoperable if you ever symlink the two installations to the same dir.
profiles_store.py (new, ~145 lines)
- Profiles at <here>/profiles/<name>.json. active_profile.txt persists.
- Seeds 5 defaults on first init: default ★, work 💼, game 🎮, sleep 🌙,
driving 🚗 — same as rust fork.
- active() / active_name() / set_active(name) / list_names() /
allows_command(cmd_id).
extensions.py (+6 handlers, +160 lines)
- do_memory_remember — derives key (first 6 words or split on '=')
- do_memory_recall — substring search or top-3 if no query
- do_memory_forget — exact then substring fallback
- do_memory_list — count + first 5 keys
- do_profile_set — target via action.target or voice ("работа" → work)
- do_profile_what — speaks current profile + description
main.py
- +6 dispatch entries for the new action types.
commands.yaml (+10 entries, 119 → 129)
- memory_remember, memory_recall, memory_forget, memory_list
- profile_work, profile_game, profile_sleep, profile_driving, profile_default
- profile_what
Tests: ast.parse passes for all .py files. yaml.safe_load gives 129 entries.
Python parity is now meaningful: memory + profiles are usable by voice
without any rust install. Still missing for full parity: scheduler (needs
background thread), macros (needs phrase-capture state), vision (needs
Groq vision model call), codebase_qa, github_pr.
This commit is contained in:
parent
f82427c7b6
commit
02c6f2f90d
5 changed files with 521 additions and 0 deletions
12
main.py
12
main.py
|
|
@ -1575,6 +1575,18 @@ def run_action(action):
|
|||
extensions.do_self_ping(action, _current_voice or '')
|
||||
elif t == 'interesting_fact':
|
||||
extensions.do_interesting_fact(action, _current_voice or '')
|
||||
elif t == 'memory_remember':
|
||||
extensions.do_memory_remember(action, _current_voice or '')
|
||||
elif t == 'memory_recall':
|
||||
extensions.do_memory_recall(action, _current_voice or '')
|
||||
elif t == 'memory_forget':
|
||||
extensions.do_memory_forget(action, _current_voice or '')
|
||||
elif t == 'memory_list':
|
||||
extensions.do_memory_list(action, _current_voice or '')
|
||||
elif t == 'profile_set':
|
||||
extensions.do_profile_set(action, _current_voice or '')
|
||||
elif t == 'profile_what':
|
||||
extensions.do_profile_what(action, _current_voice or '')
|
||||
|
||||
|
||||
_current_voice: str = ''
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue