Typocop is a precomputed relational intelligence system that transforms source code into a queryable knowledge graph. It eliminates the need for iterative file searches by precomputing the entire code structure — clustering, tracing, and scoring — and delivering complete context in a single query with 90%+ confidence.
0
stars
1
commits
TypeScript
primary language
Aug 6, 2026
updated
Precomputed Relational Intelligence System — Transform source code into a queryable knowledge graph.
Typocop is a high-performance indexing and query engine that avoids the slow, multi-query chains of traditional AI agents by precomputing entire code structures. It delivers 90%+ confidence and complete context in a single call.
grep or find. Get immediate context on callers, callees, clusters, and processes.verify_claim grounding tool that returns verdict + confidence + evidence so agents stop acting on false assumptions. Works with Kiro, Claude, Cursor, Windsurf, and Antigravity.graph TD
CLI[CLI Tool] --> Parser[AST Parser - tree-sitter]
Parser --> Phase1[Phase 1: Structure]
Phase1 --> Phase2[Phase 2: Parsing]
Phase2 --> Phase3[Phase 3: Resolution]
Phase3 --> Phase4[Phase 4: Clustering]
Phase4 --> Phase5[Phase 5: Processes]
Phase5 --> Phase6[Phase 6: Search Index]
Phase6 --> LadybugDB[(LadybugDB - Kùzu)]
LadybugDB --> LocalQuery[Local Query Server]
LadybugDB --> ConnectionServer[Connection Server - gRPC]
LocalQuery --> MCPServer[MCP Server]
ConnectionServer --> RemoteClients[Remote Clients]
CLI --> ObsidianExport[Obsidian Export]
LadybugDB --> ObsidianExport
Key components:
The MCP server exposes 11 read-only tools (none mutate your code or the graph). Each returns a structured result plus a mandatory human-readable summary. See src/apps/mcp-server/README.md for full parameters, response shape, and examples.
| Tool | What it answers |
|---|---|
get_symbol_context | 360° context for a symbol (callers, callees, clusters, processes); optional token-budgeted slicing |
smart_search | Find symbols by natural-language query (semantic/vector similarity) |
impact_analysis | Blast radius of a symbol — direct and transitive dependents, affected flows, risk, per-node role/edge/hop |
trace | Shortest call/containment path between two symbols (per-hop chain) |
trace_data_flow | Data flow from an API entry point through services to DB models |
find_dead_code | Uncalled, non-exported, non-entry-point candidates (verify before deleting) |
find_hotspots | Most complex symbols (cyclomatic / cognitive / max loop depth) |
shape_check | API contract drift — graph-wide, or scoped to one route (drift + blast radius) |
rename | Preview a coordinated rename (edge-backed edits + low-confidence regex); never writes |
detect_changes | Blast radius of uncommitted/git changes (CRITICAL for auth/payment/etc.) |
verify_claim | Grounding / anti-hallucination — verify a usage / edge / reachability claim → verdict + confidence + evidence; unprovable (dynamic dispatch / DI) → honest uncertain, never a false confirm/refute; a refute carries the true answer |
pnpm install
pnpm build
Before running the indexer, ensure you have:
Typocop supports semantic search through embeddings. By default, embeddings are disabled (EMBEDDING_PROVIDER=none).
To enable HuggingFace embeddings with automatic model download:
pnpm typocop hf
This command:
.env-typocop to set EMBEDDING_PROVIDER=huggingfacemixedbread-ai/mxbai-embed-large-v1)After running this command, re-index your codebase to generate embeddings:
pnpm typocop parse --path ./src --lang typescript --refresh
Cache Location: Models are cached at ~/.cache/huggingface/transformers by default. The cache is persistent across runs, so subsequent indexing operations will use the cached models without re-downloading. You can customize the cache location by setting HF_HOME in .env-typocop.
If you prefer to use Ollama for local embeddings, use the configuration command:
# Default (localhost:11434)
pnpm typocop ollama
# Custom Ollama server URL
pnpm typocop ollama --url http://192.168.1.100:11434
This command:
.env-typocop to set EMBEDDING_PROVIDER=ollamaOLLAMA_ENABLED=true)Ensure Ollama is running before indexing:
ollama serve
Then re-index your codebase:
pnpm typocop parse --path ./src --lang typescript --refresh
To disable semantic search (faster indexing, no model download):
EMBEDDING_PROVIDER=none
Typocop uses a configurable prefix for all LadybugDB node labels and relationship types. This allows multiple Typocop instances to share the same database infrastructure without data conflicts.
Environment variable: TYPOCOP_PREFIX
Default value: tpc_
Naming rules:
a–z)[a-z0-9_])tpc → tpc_)Examples:
| Value | Effective prefix | Example table |
|---|---|---|
| (unset) | tpc_ | tpc_embeddings |
tpc_ | tpc_ | tpc_embeddings |
myapp_ | myapp_ | myapp_embeddings |
prod_ | prod_ | prod_embeddings |
dev_ | dev_ | dev_embeddings |
What it affects:
{prefix}Symbol, {prefix}File, {prefix}Cluster, {prefix}Process, {prefix}Metadata{prefix}CALLS, {prefix}IMPORTS, {prefix}INHERITS, {prefix}IMPLEMENTS, {prefix}CONTAINS, {prefix}REFERENCES, {prefix}DEFINES{prefix}embeddings, {prefix}metadataSet it in your .env-typocop file or as a system environment variable:
TYPOCOP_PREFIX=myapp_
# General command structure
pnpm typocop parse --path <source_path> --lang <language> [--verbose] [--refresh]
# Example: TypeScript Project
pnpm typocop parse --path ./src --lang typescript --verbose
# Example: Magento 2 Project
pnpm typocop parse --path ./app/code --lang php --verbose
# Example: Python Project
pnpm typocop parse --path ./src --lang python --verbose
# With embeddings enabled (after running `pnpm typocop hf`)
pnpm typocop parse --path ./src --lang typescript --refresh
Graceful Shutdown: Press Ctrl+C at any time to cancel the parse process. The CLI will clean up resources and exit gracefully.
The --refresh flag (short form: -r) clears all existing graph and embeddings data before reindexing. This is useful when you need a clean slate.
Use cases:
pnpm typocop hfExamples:
# Full refresh with verbose output
pnpm typocop parse --path ./src --lang typescript --refresh --verbose
# Short form
pnpm typocop parse --path ./src --lang typescript -r
# Refresh without verbose output
pnpm typocop parse --path ./src --lang typescript --refresh
What happens during refresh:
Important notes:
--refresh flag is optional and defaults to falseExport your indexed knowledge graph as an Obsidian-compatible markdown vault for visual exploration and documentation:
# Export to default location (./.typocop-obsidian)
pnpm typocop obsidian
# Export to custom location
pnpm typocop obsidian --out ./my-vault
# Export with verbose output
pnpm typocop obsidian --out ./my-vault --verbose
What gets exported:
Output structure:
.typocop-obsidian/
├── symbols/
│ ├── MyClass.md
│ ├── myFunction.md
│ └── ...
├── clusters/
│ ├── authentication.md
│ ├── dataAccess.md
│ └── ...
├── processes/
│ ├── user-login-flow.md
│ ├── data-fetch-pipeline.md
│ └── ...
└── index.md
Features:
.gitignore entry for the vault directoryTypeScript, JavaScript, Python, PHP, Java, Go, Rust, C, C++, C#, Ruby, Swift
pnpm typocop status
Typocop supports a distributed architecture where the database runs as a separate gRPC server, enabling multiple clients to connect and query the same knowledge graph remotely.
# Start the connection server (listens on localhost:50051 by default)
pnpm typocop db-server
# Custom port
pnpm typocop db-server --port 50052
# Custom database path
pnpm typocop db-server --db ~/.typocop/custom/db.ladybug
# With verbose logging
pnpm typocop db-server --verbose
Server features:
Configure your client to connect to a remote connection server:
# Set environment variables
export TYPOCOP_DB_HOST=192.168.1.100
export TYPOCOP_DB_PORT=50051
export TYPOCOP_DB_MODE=remote
# Run queries against the remote database
pnpm typocop parse --path ./src --lang typescript
pnpm typocop obsidian --out ./vault
Connection configuration:
# .env-typocop
TYPOCOP_DB_MODE=remote # "local" or "remote"
TYPOCOP_DB_HOST=localhost # Server hostname/IP
TYPOCOP_DB_PORT=50051 # Server port
TYPOCOP_DB_TIMEOUT=30000 # Connection timeout (ms)
TYPOCOP_DB_MAX_RETRIES=3 # Retry attempts
pnpm typocop reindex --db ~/.typocop/tpc_/db.ladybug
The indexing pipeline (src/indexer/pipeline.ts) orchestrates all phases:
Each phase builds on the previous, with results stored in LadybugDB (graph structure and semantic search).
Typocop follows strict correctness properties validated through property-based testing (fast-check):
ISC License. See LICENSE (to be added) for more details.
1 commits
TypeScript
96.1%
Python
2.0%
JavaScript
1.3%
Typocop is a precomputed relational intelligence system that transforms source code into a queryable knowledge graph. It eliminates the need for iterative file searches by precomputing the entire code structure — clustering, tracing, and scoring — and delivering complete context in a single query with 90%+ confidence.
0
stars
1
commits
TypeScript
primary language
Aug 6, 2026
updated
Precomputed Relational Intelligence System — Transform source code into a queryable knowledge graph.
Typocop is a high-performance indexing and query engine that avoids the slow, multi-query chains of traditional AI agents by precomputing entire code structures. It delivers 90%+ confidence and complete context in a single call.
grep or find. Get immediate context on callers, callees, clusters, and processes.verify_claim grounding tool that returns verdict + confidence + evidence so agents stop acting on false assumptions. Works with Kiro, Claude, Cursor, Windsurf, and Antigravity.graph TD
CLI[CLI Tool] --> Parser[AST Parser - tree-sitter]
Parser --> Phase1[Phase 1: Structure]
Phase1 --> Phase2[Phase 2: Parsing]
Phase2 --> Phase3[Phase 3: Resolution]
Phase3 --> Phase4[Phase 4: Clustering]
Phase4 --> Phase5[Phase 5: Processes]
Phase5 --> Phase6[Phase 6: Search Index]
Phase6 --> LadybugDB[(LadybugDB - Kùzu)]
LadybugDB --> LocalQuery[Local Query Server]
LadybugDB --> ConnectionServer[Connection Server - gRPC]
LocalQuery --> MCPServer[MCP Server]
ConnectionServer --> RemoteClients[Remote Clients]
CLI --> ObsidianExport[Obsidian Export]
LadybugDB --> ObsidianExport
Key components:
The MCP server exposes 11 read-only tools (none mutate your code or the graph). Each returns a structured result plus a mandatory human-readable summary. See src/apps/mcp-server/README.md for full parameters, response shape, and examples.
| Tool | What it answers |
|---|---|
get_symbol_context | 360° context for a symbol (callers, callees, clusters, processes); optional token-budgeted slicing |
smart_search | Find symbols by natural-language query (semantic/vector similarity) |
impact_analysis | Blast radius of a symbol — direct and transitive dependents, affected flows, risk, per-node role/edge/hop |
trace | Shortest call/containment path between two symbols (per-hop chain) |
trace_data_flow | Data flow from an API entry point through services to DB models |
find_dead_code | Uncalled, non-exported, non-entry-point candidates (verify before deleting) |
find_hotspots | Most complex symbols (cyclomatic / cognitive / max loop depth) |
shape_check | API contract drift — graph-wide, or scoped to one route (drift + blast radius) |
rename | Preview a coordinated rename (edge-backed edits + low-confidence regex); never writes |
detect_changes | Blast radius of uncommitted/git changes (CRITICAL for auth/payment/etc.) |
verify_claim | Grounding / anti-hallucination — verify a usage / edge / reachability claim → verdict + confidence + evidence; unprovable (dynamic dispatch / DI) → honest uncertain, never a false confirm/refute; a refute carries the true answer |
pnpm install
pnpm build
Before running the indexer, ensure you have:
Typocop supports semantic search through embeddings. By default, embeddings are disabled (EMBEDDING_PROVIDER=none).
To enable HuggingFace embeddings with automatic model download:
pnpm typocop hf
This command:
.env-typocop to set EMBEDDING_PROVIDER=huggingfacemixedbread-ai/mxbai-embed-large-v1)After running this command, re-index your codebase to generate embeddings:
pnpm typocop parse --path ./src --lang typescript --refresh
Cache Location: Models are cached at ~/.cache/huggingface/transformers by default. The cache is persistent across runs, so subsequent indexing operations will use the cached models without re-downloading. You can customize the cache location by setting HF_HOME in .env-typocop.
If you prefer to use Ollama for local embeddings, use the configuration command:
# Default (localhost:11434)
pnpm typocop ollama
# Custom Ollama server URL
pnpm typocop ollama --url http://192.168.1.100:11434
This command:
.env-typocop to set EMBEDDING_PROVIDER=ollamaOLLAMA_ENABLED=true)Ensure Ollama is running before indexing:
ollama serve
Then re-index your codebase:
pnpm typocop parse --path ./src --lang typescript --refresh
To disable semantic search (faster indexing, no model download):
EMBEDDING_PROVIDER=none
Typocop uses a configurable prefix for all LadybugDB node labels and relationship types. This allows multiple Typocop instances to share the same database infrastructure without data conflicts.
Environment variable: TYPOCOP_PREFIX
Default value: tpc_
Naming rules:
a–z)[a-z0-9_])tpc → tpc_)Examples:
| Value | Effective prefix | Example table |
|---|---|---|
| (unset) | tpc_ | tpc_embeddings |
tpc_ | tpc_ | tpc_embeddings |
myapp_ | myapp_ | myapp_embeddings |
prod_ | prod_ | prod_embeddings |
dev_ | dev_ | dev_embeddings |
What it affects:
{prefix}Symbol, {prefix}File, {prefix}Cluster, {prefix}Process, {prefix}Metadata{prefix}CALLS, {prefix}IMPORTS, {prefix}INHERITS, {prefix}IMPLEMENTS, {prefix}CONTAINS, {prefix}REFERENCES, {prefix}DEFINES{prefix}embeddings, {prefix}metadataSet it in your .env-typocop file or as a system environment variable:
TYPOCOP_PREFIX=myapp_
# General command structure
pnpm typocop parse --path <source_path> --lang <language> [--verbose] [--refresh]
# Example: TypeScript Project
pnpm typocop parse --path ./src --lang typescript --verbose
# Example: Magento 2 Project
pnpm typocop parse --path ./app/code --lang php --verbose
# Example: Python Project
pnpm typocop parse --path ./src --lang python --verbose
# With embeddings enabled (after running `pnpm typocop hf`)
pnpm typocop parse --path ./src --lang typescript --refresh
Graceful Shutdown: Press Ctrl+C at any time to cancel the parse process. The CLI will clean up resources and exit gracefully.
The --refresh flag (short form: -r) clears all existing graph and embeddings data before reindexing. This is useful when you need a clean slate.
Use cases:
pnpm typocop hfExamples:
# Full refresh with verbose output
pnpm typocop parse --path ./src --lang typescript --refresh --verbose
# Short form
pnpm typocop parse --path ./src --lang typescript -r
# Refresh without verbose output
pnpm typocop parse --path ./src --lang typescript --refresh
What happens during refresh:
Important notes:
--refresh flag is optional and defaults to falseExport your indexed knowledge graph as an Obsidian-compatible markdown vault for visual exploration and documentation:
# Export to default location (./.typocop-obsidian)
pnpm typocop obsidian
# Export to custom location
pnpm typocop obsidian --out ./my-vault
# Export with verbose output
pnpm typocop obsidian --out ./my-vault --verbose
What gets exported:
Output structure:
.typocop-obsidian/
├── symbols/
│ ├── MyClass.md
│ ├── myFunction.md
│ └── ...
├── clusters/
│ ├── authentication.md
│ ├── dataAccess.md
│ └── ...
├── processes/
│ ├── user-login-flow.md
│ ├── data-fetch-pipeline.md
│ └── ...
└── index.md
Features:
.gitignore entry for the vault directoryTypeScript, JavaScript, Python, PHP, Java, Go, Rust, C, C++, C#, Ruby, Swift
pnpm typocop status
Typocop supports a distributed architecture where the database runs as a separate gRPC server, enabling multiple clients to connect and query the same knowledge graph remotely.
# Start the connection server (listens on localhost:50051 by default)
pnpm typocop db-server
# Custom port
pnpm typocop db-server --port 50052
# Custom database path
pnpm typocop db-server --db ~/.typocop/custom/db.ladybug
# With verbose logging
pnpm typocop db-server --verbose
Server features:
Configure your client to connect to a remote connection server:
# Set environment variables
export TYPOCOP_DB_HOST=192.168.1.100
export TYPOCOP_DB_PORT=50051
export TYPOCOP_DB_MODE=remote
# Run queries against the remote database
pnpm typocop parse --path ./src --lang typescript
pnpm typocop obsidian --out ./vault
Connection configuration:
# .env-typocop
TYPOCOP_DB_MODE=remote # "local" or "remote"
TYPOCOP_DB_HOST=localhost # Server hostname/IP
TYPOCOP_DB_PORT=50051 # Server port
TYPOCOP_DB_TIMEOUT=30000 # Connection timeout (ms)
TYPOCOP_DB_MAX_RETRIES=3 # Retry attempts
pnpm typocop reindex --db ~/.typocop/tpc_/db.ladybug
The indexing pipeline (src/indexer/pipeline.ts) orchestrates all phases:
Each phase builds on the previous, with results stored in LadybugDB (graph structure and semantic search).
Typocop follows strict correctness properties validated through property-based testing (fast-check):
ISC License. See LICENSE (to be added) for more details.
1 commits
TypeScript
96.1%
Python
2.0%
JavaScript
1.3%