feat: context compaction + skills system

Compaction:
- GemmaLLM.chat() truncates ChatContext to last 30 items (~15 turns)
  before sending to LLM, preventing context window overflow on long
  conversations. Preserves system prompt and removes orphaned tool calls.

Skills:
- agent/skills_mcp.py: MCP server with skill_save, skill_recall,
  skill_list, skill_update tools backed by .md files in /skills
- skills/ dir bind-mounted into container, git-trackable
- System prompt instructs Hope to save repeatable procedures as skills
  and recall them before performing tasks she's done before
- Distinct from memory (facts) — skills are learned *procedures*
This commit is contained in:
Shane
2026-08-22 16:42:16 -04:00
parent de1a5d8400
commit ab6b5254ef
6 changed files with 250 additions and 2 deletions
View File
+35
View File
@@ -0,0 +1,35 @@
# Skills
Skills are learned procedures that Hope distills from conversations.
One `.md` file per skill, saved here by the skills MCP server
(`agent/skills_mcp.py`) and mounted into the container at `/skills`.
## How they differ from memory
- **Memory** (`./memory/`) stores *facts*: names, preferences, things
Hope should remember.
- **Skills** (this directory) store *how to do things*: repeatable
procedures, workflows, and multi-step tasks Hope has learned.
## File format
```markdown
# Make a Coffee Order
How to place an order at the local coffee shop on behalf of the user.
## Steps
1. Confirm the usual drink (oat latte, extra hot).
2. Ask if they want anything new today.
3. Read back the order and confirm.
4. Tell them the pickup time.
---
Created: 2026-08-22T12:00:00+00:00
Source: conversation-learned
```
Hope saves a skill when it successfully completes a multi-step task or
the user teaches it a new procedure, and recalls one with `skill_recall`
before performing a task it has done before. Skills are updated in place
when the procedure improves.