Skillware skills · optimization/context_optimizer
Context Optimizer
Query-aware extractive context selection for large documents — local fastembed embeddings score chunks against agent_goal and return verbatim spans up to max_tokens_return. Mini-RAG without paraphrase; chain after prompt_injection_firewall for untrusted text.
Capabilities
- Extractive selection
- Local fastembed
- Traceable chunks
- Fail-closed empty_result
Problems this skill solves
People search for tasks — not always "skillware":
- reduce document context before llm call
- select relevant chunks from long document agent
- extractive rag without vector database agent
- context window optimizer ai agent python
- semantic chunk selection agent skill
- filter document spans by agent goal
Install
pip install skillware then SkillLoader.load_skill("optimization/context_optimizer")
FAQ
- How is Context Optimizer different from Prompt Rewriter?
- Context Optimizer selects verbatim spans from a document; Prompt Rewriter compresses text. Use the optimizer first to pick relevant chunks, then the rewriter if you still need token savings.