Memory index

From 0dayInc/pwn · View interactive version

Memory index is an AI agent skill from the GitHub repository 0dayInc/pwn. Drive PWN::MemoryIndex from pwn_eval.

How to use this skill

Skill file

PWN::MemoryIndex

PWN::MemoryIndex is a lightweight local embedding index over PWN::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::Env[:ai][: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): { "<key>": { "sha": "<sha16 of value>", "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::MemoryIndex from pwn_eval when the task needs this module.

Do not reimplement it in shell.

Methodologies

Generated from pwn/memory_index.rb. Prefer the public class methods below.

Class methods take (opts = {}) and read opts.

How to call

PWN::MemoryIndex.help
PWN::MemoryIndex.available(opts)

Public methods

Source

pwn/memory_index.rb

Verification

PWN::MemoryIndex.respond_to?(:available) after the

module is loaded. Read the source for parameter names.

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.