query

query is a command for coding agents from ramdhavepreetam/NervaPack. It costs 0 tokens per session (680 once invoked), scanned A, original, MIT.

A natural-language search command for a knowledge graph of code and related project information. It finds relevant code nodes and expands through their relationships.

In plain words
What is it for?
Use it to look up symbols, ask how code works, find what depends on a change, and retrieve related project context.
Why use it?
It helps answer code questions without manually searching files or tracing dependencies. It can also include stored decisions connected to the relevant files.

Command

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add commands/ramdhavepreetam/nervapack/query
Clone the repo
git clone --depth 1 https://github.com/ramdhavepreetam/NervaPack

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for query

README.md
[![agentmods](https://agentmods.dev/badge/commands/ramdhavepreetam/nervapack/query.svg)](https://agentmods.dev/commands/ramdhavepreetam/nervapack/query)
Your own site
<a href="https://agentmods.dev/commands/ramdhavepreetam/nervapack/query"><img src="https://agentmods.dev/badge/commands/ramdhavepreetam/nervapack/query.svg" alt="Measured on agentmods" height="20"></a>
Per session 0 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 680 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5 $0.00000 $0.00680
Opus 5 $0.00000 $0.00340
Sonnet 5 $0.00000 $0.00136
Haiku 4.5 $0.00000 $0.00068

Measured 3d ago against content hash 14f5e5fab791, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

query scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 3d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

docs/user-guide/commands/query.md · 95 lines

How it starts

The opening of the file, as written. The whole thing — 95 lines — stays where its author put it; the contents beside it link to each section on GitHub.

nervapack query

Search the knowledge graph using natural language.


Synopsis

nervapack query "<prompt>"

Description

The query command retrieves focused, token-efficient context from the knowledge graph for a given prompt. It uses a query router that selects the best retrieval strategy automatically:

  1. Impact intent — if the prompt starts with "what breaks if I change ..." or contains "impact of", triggers reverse dependency traversal to find callers and dependents.
  2. Exact symbol match — if the prompt exactly matches a node name in the graph, seeds the BFS from that node directly, bypassing vector search.
  3. Semantic (vector) search — default fallback; embeds the prompt and finds the nearest nodes in ChromaDB, then expands with K-Hop BFS.

After retrieving a subgraph, query also injects any memory nodes that TOUCH the retrieved source files, so you see relevant past decisions alongside live code context.


Arguments

Argument Description
PROMPT Natural language question or symbol name

Examples

Standard semantic query

nervapack query "How does the token counting work?"

Exact symbol lookup

nervapack query "GraphRetriever"

Impact analysis

nervapack query "what breaks if I change VectorStore"
nervapack query "impact of GraphBuilder"

Output

Query Router: Intent: semantic, Direction: both
Vector Search: Found 3 seed nodes

┌─┬──────────┬──────────────────────────────┐
│#│ Node Type│ Name/File                    │
├─┼──────────┼──────────────────────────────┤
│1│ function │ count_tokens                 │
│2│ function │ render_savings_panel         │
│3│ import   │ tiktoken                     │
└─┴──────────┴──────────────────────────────┘

Graph Traversal: Expanding with max_hops=1, direction=both

📁 token_meter.py (2 entities)
  ⚙ count_tokens [seed]
  ⚙ render_savings_panel [seed]
    ← EXPLAINS: Token Efficiency

────────────────────────────────────────────────────────────
Retrieved Context (Markdown)
────────────────────────────────────────────────────────────
...

╭──────────────  NervaPack Token Efficiency  ──────────────╮
│  Naive RAG    12,340   ████████████  100% (base)         │
│  NervaPack       893   █░░░░░░░░░░░    7.2%              │
│  Tokens saved: 11,447   Reduction: 92.8%                 │
╰───────────────────────────────────────────────────────────╯

Read the full file on GitHub · 95 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 3d ago First seen · 95 lines · 0 tokens per session scan A 14f5e5fab791

Subscribe to this mod's changes

query is a command published in the GitHub repository ramdhavepreetam/NervaPack (1 stars, last pushed 9d ago), licensed MIT. It costs nothing until one of its globs matches a file; then it loads 680 tokens. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.