[Sovereignty P0] Skill Library — Embedding Retrieval for LLM Replacement #956

Closed
opened 2026-03-22 18:23:02 +00:00 by perplexity · 0 comments
Collaborator

Parent

Part of #953 (The Sovereignty Loop) — P0 priority

Governing Principle

"Reason Once, Rule Forever" — Eliminates 80% of LLM cost within weeks.

Goal

Build the skill library using the Voyager pattern. Each crystallized skill is a named function with a natural language description, an embedding for semantic retrieval, a success rate, and application conditions. When a new decision arises, the agent searches by embedding similarity before invoking the LLM.

Implementation

  1. Create src/timmy/sovereignty/skill_library.py:
    • SkillLibrary class:
      • search(situation_embedding) -> list[Skill] — semantic retrieval
      • add(skill) — store new crystallized skill
      • update_success_rate(skill_id, succeeded: bool) — track effectiveness
    • Match threshold: >0.8 confidence AND >0.6 success rate → execute without LLM
  2. Skill document format (agentskills.io standard):
name: navigate_spawn_to_dungeon
game: morrowind
type: navigation
success_rate: 0.85
times_used: 12
sovereignty_value: high  # replaced ~40 LLM calls
  1. Storage: data/skills/ directory, one markdown file per skill with YAML frontmatter
  2. Embedding index: ChromaDB or Qdrant Edge (per #903 State-of-Art recommendations) for fast similarity search
  3. Crystallization functions for each decision type:
    • Navigation → waypoint sequence
    • Combat → if/else rules on health + enemy type
    • Dialog → cached preference per NPC
    • Inventory → rule: keep top N by value

Metrics Targets

  • 70-80% of decisions without LLM by week 4
  • 5 new skills crystallized per play session

Effort Estimate

2 days

Cross-references

  • #953 (Sovereignty Loop — Section III.2, V.3)
  • #873 (Three-Tier Memory — skills stored in Vault tier)
  • #883 (UESP Knowledge Base — quest/NPC data feeds skill crystallization)
  • #903 (State-of-Art — ChromaDB v1.5.5 / Qdrant Edge for embeddings)
## Parent Part of #953 (The Sovereignty Loop) — P0 priority ## Governing Principle > "Reason Once, Rule Forever" — Eliminates 80% of LLM cost within weeks. ## Goal Build the skill library using the Voyager pattern. Each crystallized skill is a named function with a natural language description, an embedding for semantic retrieval, a success rate, and application conditions. When a new decision arises, the agent searches by embedding similarity before invoking the LLM. ## Implementation 1. Create `src/timmy/sovereignty/skill_library.py`: - `SkillLibrary` class: - `search(situation_embedding) -> list[Skill]` — semantic retrieval - `add(skill)` — store new crystallized skill - `update_success_rate(skill_id, succeeded: bool)` — track effectiveness - Match threshold: >0.8 confidence AND >0.6 success rate → execute without LLM 2. Skill document format (agentskills.io standard): ```yaml name: navigate_spawn_to_dungeon game: morrowind type: navigation success_rate: 0.85 times_used: 12 sovereignty_value: high # replaced ~40 LLM calls ``` 3. Storage: `data/skills/` directory, one markdown file per skill with YAML frontmatter 4. Embedding index: ChromaDB or Qdrant Edge (per #903 State-of-Art recommendations) for fast similarity search 5. Crystallization functions for each decision type: - Navigation → waypoint sequence - Combat → if/else rules on health + enemy type - Dialog → cached preference per NPC - Inventory → rule: keep top N by value ## Metrics Targets - 70-80% of decisions without LLM by week 4 - >5 new skills crystallized per play session ## Effort Estimate 2 days ## Cross-references - #953 (Sovereignty Loop — Section III.2, V.3) - #873 (Three-Tier Memory — skills stored in Vault tier) - #883 (UESP Knowledge Base — quest/NPC data feeds skill crystallization) - #903 (State-of-Art — ChromaDB v1.5.5 / Qdrant Edge for embeddings)
claude was assigned by Rockachopa 2026-03-22 23:31:25 +00:00
claude added the harnessmorrowindp1-important labels 2026-03-23 13:53:55 +00:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: Rockachopa/Timmy-time-dashboard#956