Skip to content

Context Tools

Context tools retrieve ranked, token-budgeted information from the knowledge graph. They are the primary entry point for understanding code and notes before reading source files.

Code-only Personalized PageRank. It does not return notes, tags, or wikilinks. Use it for the symbols around a function or class. brain_context is the code-plus-notes walk.

A seed may be a symbol name, a sym: UID, or a repo-relative file path. The engine expands a path to the symbols in that file. A question belongs on investigate.

ParameterTypeRequiredDescription
seedsstring[]YesSymbol names, sym: UIDs, or one repo-relative file path.
limitintegerNoMaximum connected symbols to return. Default 500. Maximum 5000. The response reports when it truncates.
intentstringNofind-definition, understand-architecture, analyze-impact, general-context, or project-context, plus their short aliases. Omit for the standard damping.

Retrieve PPR-ranked structural context from the knowledge graph, seeded by symbol names, note titles, or keywords. Returns mixed-kind results (Symbol, Note, Section, Tag, Heading) within a token budget.

Use brain_context as the primary entry point for understanding a topic. Seed with specific names (e.g. AuthService.validate), not broad terms. Filter with repos, tags, path_prefix, and kinds for precision.

ParameterTypeRequiredDescription
seedsstring[]YesOne or more seed strings to anchor the PPR walk. Accepts note titles, tag names (with or without #), symbol names, free-text terms, or UIDs (sym:, note:, head:, sec:, tag:).
token_budgetintegerNoApproximate cap on the connected list (chars / 4). Default 2000.
response_formatstringNo"concise" returns names and relationships only; "detailed" (default) adds file paths, relevance scores, and UIDs.
reposstring[]NoFilter to specific repo UIDs or names (post-PPR).
vaultsstring[]NoFilter to specific vault UIDs or names (post-PPR).
kindsstring[]NoInclude only nodes with these kind prefixes (e.g. Symbol, Note, Section). Case-insensitive prefix match.
path_prefixstringNoInclude only nodes whose file path starts with this prefix.
tagsstring[]NoInclude only notes and sections with these tags. Symbol nodes have no tags and are dropped.
exclude_tagsstring[]NoExclude nodes tagged with any of these tags.
weight_pprnumberNoPPR ranking weight. Omitted calls use 0.40.
weight_bm25numberNoBM25 weight. Omitted calls use 0.25.
weight_semanticnumberNoSemantic weight. The stored default is 0.35. The semantic leg is skipped until nestweaver embed has written vectors.
sincestringNoISO 8601 timestamp. Only return Note/Section nodes modified after this time. Symbol nodes always kept.
recency_weightnumberNoMultiplier for age-decay boost. 0 = disabled (default). 1.0 = same-day node ranks ~2x a year-old node.
recency_half_life_daysnumberNoHalf-life for age-decay in days. Default 30.
intentstringNoQuery intent hint: "find-definition", "understand-architecture", "analyze-impact", or "general-context". Adjusts ranking strategy.
include_seedsbooleanNoWhen true, include the full seeds array in the response. Default false.
include_bodiesbooleanNoWhen true, embed high-relevance result source bodies inline under inline_body. Only results clearing the relevance threshold (default 0.75) get a body. Default false.
rootstringNoFilesystem root for resolving source spans for inline bodies. Only relevant with include_bodies=true.
prfbooleanNoWhen true, run pseudo-relevance-feedback query expansion on the BM25 leg. Improves recall on natural-language seeds. Default false.
rerankbooleanNoWhen true, rerank top-N candidates before truncation. Default false.

Find notes, headings, sections, tags, and code symbols by keyword or phrase using BM25 full-text search.

Use brain_search for keyword or phrase lookup. For structural context (“what’s connected to X”), use brain_context instead.

ParameterTypeRequiredDescription
querystringYesFree-text query. Natural language works. Example: "database migration" or "AuthService".
limitintegerNoMaximum results to return. Default 20.
response_formatstringNo"concise" returns note titles and kinds only; "detailed" (default) adds section text excerpts, BM25 scores, and vault UIDs.
include_bodiesbooleanNoWhen true (detailed mode only), embed high-relevance hit source bodies inline. Default false.
rootstringNoFilesystem root for reading source spans. Only relevant with include_bodies=true.
prfbooleanNoWhen true, run pseudo-relevance-feedback query expansion. Default false.
rerankbooleanNoWhen true (detailed mode only), rerank top-N hits before truncation. Default false.

Retrieve all context for a named project: notes, symbols, and sections ranked by PPR within the project’s subgraph, bounded by token budget.

Use when you know the project name. For ad-hoc topics, use brain_context with seeds instead.

ParameterTypeRequiredDescription
projectstringYesProject name (e.g. "AuthService"), alias, or UID.
token_budgetintegerNoApproximate token cap. Omitted calls follow response_format: about 1000 for concise (the default) and about 3000 for detailed.
kindsstring[]NoFilter result kinds: "Symbol" for code, "Note" for documents. Case-insensitive prefix match.
include_componentsbooleanNoFor composite projects, include content from component sub-projects. Default true.
sincestringNoISO 8601 timestamp. Only return Note/Section nodes modified after this time.
recency_weightnumberNoMultiplier for age-decay boost. Default 0.0 (disabled).
recency_half_life_daysnumberNoHalf-life for age-decay in days. Default 30.
include_seedsbooleanNoWhen true, include the full seeds array in the response. Default false.
intentstringNoQuery intent hint: "find-definition", "understand-architecture" (default for project_context), "analyze-impact", or "general-context".

Generate deterministic architectural summaries at three granularity levels: symbol, file, or cluster. Derived from graph data without an LLM.

ParameterTypeRequiredDescription
levelstringNoSummary granularity: "symbol" (per-function/class), "file" (per-file exports, default), or "cluster" (per-community architecture).
targetstringNoFilter by file path, symbol name, or cluster name substring. Only matching summaries are returned.
token_budgetintegerNoApproximate token cap. Default unlimited.

Show what knowledge sources are indexed: vault/repo counts, note/tag/wikilink totals, staleness warnings, and search engine availability.

No parameters required. Call at session start to verify expected vaults and repos are loaded.

Generate a comprehensive orientation guide covering all indexed repos, vaults, cross-repo relationships, and available tools.

No parameters required. Call at session start for a read-once overview before issuing specific queries. Can be expensive on large graphs; prefer brain_status for lightweight session initialization.

Show what changed since the graph was last indexed: files added, modified, or deleted, plus affected symbols. Works with locally-indexed repos only.

ParameterTypeRequiredDescription
repostringYesRepo name or substring of its URL (e.g. "nestweaver"). Matched against indexed repos.
since_shastringNoGit SHA to compare against. Defaults to the repo’s indexed SHA.
limitintegerNoMax affected symbols to return (default 50). Total count is always reported.