name: pwn-ai-memory-index description: Drive PWN::AI::Memory::Index from pwn_eval. license: MIT allowed-tools: [pwn, pwn_eval] metadata: bundled: true generated: true module: PWN::AI::Memory::Index source: pwn/ai/memory/index.rb
PWN::AI::Memory::Index
PWN::AI::Memory::Index is a lightweight local embedding index over PWN::AI::Memory (/.pwn/memory.json) so PromptBuilder can inject the N MOST-RELEVANT memories for the current request instead of the N newest. Embeddings prefer a direct Ollama /api/embed endpoint (PWN::Config::Env[:ai][:providers][:ollama][:embed_model], default 'nomic-embed-text'). When only Open WebUI is configured, embeddings go through its /ollama/api/embed proxy with the openwebui key/base_uri. Index layout (/.pwn/memory.idx): { "": { "sha": "", "vec": [Float,…] }, … } Rebuilds are incremental: only entries whose value-sha changed are (re)embedded, so a warm index costs one embed call (the query).
When to use
Call PWN::AI::Memory::Index from pwn_eval when the task needs this module.
Do not reimplement it in shell.
Methodologies
Generated from pwn/ai/memory/index.rb. Prefer the public class methods below.
Class methods take (opts = {}) and read opts.
How to call
PWN::AI::Memory::Index.help
PWN::AI::Memory::Index.available?(opts)
Public methods
available?recall_semanticto_contextrefreshembedresetbm25authorshelp
Source
pwn/ai/memory/index.rb
Verification
PWN::AI::Memory::Index.respond_to?(:available?) after the
module is loaded. Read the source for parameter names.
