Skip to main content
The Termux Monorepo maintains a set of knowledge indices that map code structure, function signatures, file relationships, and dependency graphs. You should rebuild these indices after large refactors, new component imports, or any change that alters the AST shape of the codebase. This guide covers the full rebuild pipeline, individual scripts, and how to query the results.

When to rebuild

Rebuild the indices when any of the following occur:
  • You add, remove, or rename a module or package
  • Function signatures change across multiple files
  • You merge a refactor that touches imports or cross-file references
  • The llm_index.jsonl, func_index.jsonl, file_graph.json, or deps.jsonl files are older than the latest commit

Combined rebuild pipeline

The fastest way to regenerate everything is the chained command used by the Central Mapper:
This runs the AST index builder, the function index builder, and the forensic linker in sequence. Expected output:

Individual build scripts

If you only need to update one layer, run the specific script directly. Build all indices from scratch:
Build the LLM-readable index:
Build the AST index from existing sources:
Build the dependency graph (fast):

Querying the index

After rebuilding, use archivist.py to search the knowledge base for files, functions, or relationships.
Expected output:
Use the context-relationship-graph skill for reconnaissance before making changes. Run archivist.py --graph --file <target> to see which files depend on your target so you can plan impact before you edit.
The index files live in workspace/llm_map/:
  • llm_index.jsonl — file-level metadata for LLM context
  • func_index.jsonl — function signatures and docstrings
  • file_graph.json — file-to-file reference graph
  • deps.jsonl — import and module dependency list
For a deeper investigation of what changed after a rebuild, see the Forensics guide. To understand how the mapper fits into the overall system, read the Central Mapper component overview.