|
1
|
# Navegador — Claude Context |
|
2
|
|
|
3
|
## What it is |
|
4
|
|
|
5
|
AST + knowledge graph context engine for AI coding agents. Parses codebases into a FalkorDB property graph. Agents query via MCP or Python API. |
|
6
|
|
|
7
|
## Stack |
|
8
|
|
|
9
|
- **Python 3.12+**, standalone (no Django dependency) |
|
10
|
- **tree-sitter** for multi-language AST parsing (13 languages) |
|
11
|
- **FalkorDB** graph DB with **falkordblite** (SQLite via redislite) for local use |
|
12
|
- **MCP** (`mcp` Python SDK) for AI agent integration (11 tools) |
|
13
|
- **Click + Rich** for CLI |
|
14
|
- **Pydantic** for data models |
|
15
|
- **Ruff** for linting/formatting |
|
16
|
|
|
17
|
## Package layout |
|
18
|
|
|
19
|
``` |
|
20
|
navegador/ |
|
21
|
cli/ — Click commands (50+ subcommands) |
|
22
|
graph/ — GraphStore + schema + queries + migrations + export |
|
23
|
ingestion/ — RepoIngester + 13 language parsers + optimization |
|
24
|
context/ — ContextLoader + ContextBundle (JSON/markdown) |
|
25
|
mcp/ — MCP server with 11 tools + security hardening |
|
26
|
enrichment/ — FrameworkEnricher base + 8 framework enrichers |
|
27
|
analysis/ — impact, flow tracing, dead code, cycles, test mapping |
|
28
|
intelligence/ — semantic search, community detection, NLP, doc generation |
|
29
|
cluster/ — Redis pub/sub, task queue, locking, sessions, messaging |
|
30
|
sdk.py — Python SDK (Navegador class) |
|
31
|
llm.py — LLM provider abstraction (Anthropic, OpenAI, Ollama) |
|
32
|
vcs.py — VCS abstraction (Git, Fossil) |
|
33
|
diff.py — Git diff → graph impact mapping |
|
34
|
churn.py — Behavioural coupling from git history |
|
35
|
monorepo.py — Workspace detection + ingestion |
|
36
|
security.py — Sensitive content detection + redaction |
|
37
|
explorer/ — HTTP server + browser-based graph visualization |
|
38
|
``` |
|
39
|
|
|
40
|
## FalkorDB connection |
|
41
|
|
|
42
|
```python |
|
43
|
# SQLite (local, zero-infra) — uses falkordblite |
|
44
|
from redislite import FalkorDB # falkordblite provides this |
|
45
|
db = FalkorDB("path/to/graph.db") |
|
46
|
graph = db.select_graph("navegador") |
|
47
|
|
|
48
|
# Redis (production) |
|
49
|
import falkordb |
|
50
|
client = falkordb.FalkorDB.from_url("redis://localhost:6379") |
|
51
|
``` |
|
52
|
|
|
53
|
## Adding a new language parser |
|
54
|
|
|
55
|
1. Create `navegador/ingestion/<lang>.py` subclassing `LanguageParser` |
|
56
|
2. Implement `parse_file(path, repo_root, store) -> dict[str, int]` |
|
57
|
3. Add the extension + language key to `LANGUAGE_MAP` in `parser.py` |
|
58
|
4. Register in `RepoIngester._get_parser()` |
|
59
|
|
|
60
|
## Adding a new framework enricher |
|
61
|
|
|
62
|
1. Create `navegador/enrichment/<framework>.py` subclassing `FrameworkEnricher` |
|
63
|
2. Implement `framework_name`, `detection_patterns`, `enrich()` |
|
64
|
3. The CLI auto-discovers enrichers via `pkgutil` — no registration needed |
|
65
|
|
|
66
|
## Adding a new MCP tool |
|
67
|
|
|
68
|
1. Add a `Tool(...)` entry in `list_tools()` in `mcp/server.py` |
|
69
|
2. Add a handler branch in `call_tool()` |
|
70
|
|
|
71
|
## Running tests |
|
72
|
|
|
73
|
```bash |
|
74
|
pip install -e ".[dev]" |
|
75
|
pytest tests/ -v |
|
76
|
``` |
|
77
|
|
|
78
|
## Linting |
|
79
|
|
|
80
|
```bash |
|
81
|
ruff check navegador/ |
|
82
|
ruff format navegador/ |
|
83
|
``` |
|
84
|
|
|
85
|
## Docs |
|
86
|
|
|
87
|
```bash |
|
88
|
pip install -e ".[docs]" |
|
89
|
mkdocs serve # local preview at http://localhost:8000 |
|
90
|
mkdocs gh-deploy --force # deploy to navegador.dev |
|
91
|
``` |
|
92
|
|