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
|
|
@ -1033,3 +1033,83 @@ interesting_fact:
|
|||
- интересный факт
|
||||
- расскажи факт
|
||||
action: {type: interesting_fact}
|
||||
|
||||
memory_remember:
|
||||
phrases:
|
||||
- запомни обо мне
|
||||
- запомни что
|
||||
- помни что
|
||||
- запомни это
|
||||
- запомни про меня
|
||||
action: {type: memory_remember}
|
||||
|
||||
memory_recall:
|
||||
phrases:
|
||||
- что ты помнишь о
|
||||
- что ты знаешь обо мне
|
||||
- что помнишь про
|
||||
- вспомни
|
||||
action: {type: memory_recall}
|
||||
|
||||
memory_forget:
|
||||
phrases:
|
||||
- забудь про
|
||||
- забудь что
|
||||
- забудь обо мне
|
||||
action: {type: memory_forget}
|
||||
|
||||
memory_list:
|
||||
phrases:
|
||||
- что ты помнишь
|
||||
- что ты знаешь обо мне всё
|
||||
- покажи память
|
||||
action: {type: memory_list}
|
||||
|
||||
profile_work:
|
||||
phrases:
|
||||
- режим работа
|
||||
- включи режим работы
|
||||
- рабочий режим
|
||||
- переключись в работу
|
||||
action: {type: profile_set, target: work}
|
||||
|
||||
profile_game:
|
||||
phrases:
|
||||
- режим игра
|
||||
- игровой режим
|
||||
- включи игровой режим
|
||||
- переключись в игры
|
||||
action: {type: profile_set, target: game}
|
||||
|
||||
profile_sleep:
|
||||
phrases:
|
||||
- режим сон
|
||||
- ночной режим
|
||||
- режим тишины
|
||||
- иди спать
|
||||
- выключи всё
|
||||
action: {type: profile_set, target: sleep}
|
||||
|
||||
profile_driving:
|
||||
phrases:
|
||||
- режим за рулём
|
||||
- режим вождения
|
||||
- я за рулём
|
||||
- поехали
|
||||
action: {type: profile_set, target: driving}
|
||||
|
||||
profile_default:
|
||||
phrases:
|
||||
- обычный режим
|
||||
- режим по умолчанию
|
||||
- сбрось режим
|
||||
- вернись в обычный
|
||||
action: {type: profile_set, target: default}
|
||||
|
||||
profile_what:
|
||||
phrases:
|
||||
- какой сейчас режим
|
||||
- в каком ты режиме
|
||||
- текущий режим
|
||||
- какой режим
|
||||
action: {type: profile_what}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue