context_filter
Filter large local text files by relevance to a query, returning verbatim line-numbered spans to keep context small.
Instructions
Extract only the parts of a large local text file that are relevant to a question.
Use this instead of reading a big build log, test output, diff, or data file into your context. Write the output to a file first, then filter it:
make 2>&1 | tee /tmp/build.log
context_filter("/tmp/build.log", "why did the linker step fail")Returns spans copied verbatim from the file with exact line numbers, never a summary, so quoted text and line numbers can be cited. It also reports how much was dropped and how close the best dropped chunk scored, so you can tell when to widen the query or raise limit rather than assuming full coverage.
Chunks are embedded on the Intel NPU and ranked by cosine similarity; nothing is written to the semantic index and nothing leaves this machine. This is not a substitute for grep: when you know the exact string to look for, grep is faster, free, and exact. Files under 4 KB and over 256 KB are rejected.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| path | Yes | ||
| limit | No | ||
| query | Yes | ||
| context_lines | No |