topolox 0.1.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- topolox-0.1.0/.env.example +10 -0
- topolox-0.1.0/.github/ISSUE_TEMPLATE/bug_report.yml +39 -0
- topolox-0.1.0/.github/ISSUE_TEMPLATE/feature_request.yml +22 -0
- topolox-0.1.0/.github/PULL_REQUEST_TEMPLATE.md +16 -0
- topolox-0.1.0/.github/dependabot.yml +11 -0
- topolox-0.1.0/.github/workflows/ci.yml +43 -0
- topolox-0.1.0/.github/workflows/release.yml +24 -0
- topolox-0.1.0/.gitignore +27 -0
- topolox-0.1.0/.pre-commit-config.yaml +14 -0
- topolox-0.1.0/.python-version +1 -0
- topolox-0.1.0/CHANGELOG.md +23 -0
- topolox-0.1.0/CODE_OF_CONDUCT.md +61 -0
- topolox-0.1.0/CONTRIBUTING.md +45 -0
- topolox-0.1.0/LICENSE +21 -0
- topolox-0.1.0/PKG-INFO +129 -0
- topolox-0.1.0/README.md +90 -0
- topolox-0.1.0/ROADMAP.md +91 -0
- topolox-0.1.0/SECURITY.md +16 -0
- topolox-0.1.0/pyproject.toml +115 -0
- topolox-0.1.0/src/topolox/__init__.py +7 -0
- topolox-0.1.0/src/topolox/__main__.py +8 -0
- topolox-0.1.0/src/topolox/cli/__init__.py +3 -0
- topolox-0.1.0/src/topolox/cli/app.py +291 -0
- topolox-0.1.0/src/topolox/config.py +31 -0
- topolox-0.1.0/src/topolox/daemon/__init__.py +3 -0
- topolox-0.1.0/src/topolox/daemon/service.py +84 -0
- topolox-0.1.0/src/topolox/daemon/watcher.py +51 -0
- topolox-0.1.0/src/topolox/errors.py +19 -0
- topolox-0.1.0/src/topolox/graph/__init__.py +3 -0
- topolox-0.1.0/src/topolox/graph/kuzu_store.py +121 -0
- topolox-0.1.0/src/topolox/graph/queries.py +3 -0
- topolox-0.1.0/src/topolox/graph/schema.py +19 -0
- topolox-0.1.0/src/topolox/graph/store.py +59 -0
- topolox-0.1.0/src/topolox/graph/writer.py +14 -0
- topolox-0.1.0/src/topolox/index/__init__.py +3 -0
- topolox-0.1.0/src/topolox/index/indexer.py +128 -0
- topolox-0.1.0/src/topolox/index/pipeline.py +3 -0
- topolox-0.1.0/src/topolox/logging.py +30 -0
- topolox-0.1.0/src/topolox/mcp/__init__.py +3 -0
- topolox-0.1.0/src/topolox/mcp/context.py +26 -0
- topolox-0.1.0/src/topolox/mcp/install.py +129 -0
- topolox-0.1.0/src/topolox/mcp/server.py +55 -0
- topolox-0.1.0/src/topolox/mcp/tools.py +47 -0
- topolox-0.1.0/src/topolox/models/__init__.py +26 -0
- topolox-0.1.0/src/topolox/models/edges.py +26 -0
- topolox-0.1.0/src/topolox/models/graph.py +20 -0
- topolox-0.1.0/src/topolox/models/nodes.py +43 -0
- topolox-0.1.0/src/topolox/models/query.py +42 -0
- topolox-0.1.0/src/topolox/parsing/__init__.py +3 -0
- topolox-0.1.0/src/topolox/parsing/discovery.py +71 -0
- topolox-0.1.0/src/topolox/parsing/extractor.py +208 -0
- topolox-0.1.0/src/topolox/parsing/languages.py +177 -0
- topolox-0.1.0/src/topolox/parsing/pool.py +40 -0
- topolox-0.1.0/src/topolox/parsing/queries/python.scm +12 -0
- topolox-0.1.0/src/topolox/parsing/worker.py +34 -0
- topolox-0.1.0/src/topolox/py.typed +0 -0
- topolox-0.1.0/src/topolox/query/__init__.py +3 -0
- topolox-0.1.0/src/topolox/query/blast_radius.py +77 -0
- topolox-0.1.0/src/topolox/query/dependencies.py +53 -0
- topolox-0.1.0/src/topolox/query/pruner.py +82 -0
- topolox-0.1.0/src/topolox/query/scoring.py +12 -0
- topolox-0.1.0/src/topolox/ui/__init__.py +3 -0
- topolox-0.1.0/src/topolox/ui/app.py +8 -0
- topolox-0.1.0/src/topolox/ui/dashboard.py +3 -0
- topolox-0.1.0/src/topolox/ui/messages.py +3 -0
- topolox-0.1.0/src/topolox/ui/panes.py +3 -0
- topolox-0.1.0/src/topolox/ui/providers.py +36 -0
- topolox-0.1.0/src/topolox/ui/styles.tcss +22 -0
- topolox-0.1.0/src/topolox/vectors/__init__.py +3 -0
- topolox-0.1.0/src/topolox/vectors/embedder.py +59 -0
- topolox-0.1.0/src/topolox/vectors/lancedb_store.py +91 -0
- topolox-0.1.0/src/topolox/vectors/schema.py +6 -0
- topolox-0.1.0/src/topolox/vectors/store.py +37 -0
- topolox-0.1.0/tests/conftest.py +13 -0
- topolox-0.1.0/tests/fixtures/sample_repo/main.py +9 -0
- topolox-0.1.0/tests/fixtures/sample_repo/pkg/__init__.py +0 -0
- topolox-0.1.0/tests/fixtures/sample_repo/pkg/auth.py +11 -0
- topolox-0.1.0/tests/fixtures/sample_repo/pkg/db.py +9 -0
- topolox-0.1.0/tests/integration/test_daemon.py +59 -0
- topolox-0.1.0/tests/integration/test_install.py +53 -0
- topolox-0.1.0/tests/integration/test_languages.py +43 -0
- topolox-0.1.0/tests/integration/test_mcp.py +67 -0
- topolox-0.1.0/tests/integration/test_query.py +107 -0
- topolox-0.1.0/tests/integration/test_storage.py +61 -0
- topolox-0.1.0/tests/unit/test_discovery.py +23 -0
- topolox-0.1.0/tests/unit/test_extractor.py +50 -0
- topolox-0.1.0/tests/unit/test_models.py +49 -0
- topolox-0.1.0/tests/unit/test_smoke.py +35 -0
- topolox-0.1.0/topolox_project_vision-v2.md +76 -0
- topolox-0.1.0/uv.lock +3036 -0
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
# Topolox settings — all are optional and prefixed with TOPOLOX_.
|
|
2
|
+
# Copy to .env and uncomment to override defaults.
|
|
3
|
+
|
|
4
|
+
# TOPOLOX_DATA_DIR=.topolox
|
|
5
|
+
# TOPOLOX_MAX_WORKERS=
|
|
6
|
+
# TOPOLOX_EMBEDDING_MODEL=BAAI/bge-small-en-v1.5
|
|
7
|
+
# TOPOLOX_LOG_LEVEL=INFO
|
|
8
|
+
|
|
9
|
+
# Only needed for the TUI chat pane (install with the [llm] extra):
|
|
10
|
+
# ANTHROPIC_API_KEY=sk-ant-...
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
name: Bug report
|
|
2
|
+
description: Report a problem with Topolox
|
|
3
|
+
labels: ["bug"]
|
|
4
|
+
body:
|
|
5
|
+
- type: textarea
|
|
6
|
+
id: what-happened
|
|
7
|
+
attributes:
|
|
8
|
+
label: What happened?
|
|
9
|
+
description: A clear description of the bug, including what you expected instead.
|
|
10
|
+
validations:
|
|
11
|
+
required: true
|
|
12
|
+
- type: textarea
|
|
13
|
+
id: repro
|
|
14
|
+
attributes:
|
|
15
|
+
label: Steps to reproduce
|
|
16
|
+
placeholder: |
|
|
17
|
+
1. Run `topolox ...`
|
|
18
|
+
2. ...
|
|
19
|
+
validations:
|
|
20
|
+
required: true
|
|
21
|
+
- type: input
|
|
22
|
+
id: version
|
|
23
|
+
attributes:
|
|
24
|
+
label: Topolox version
|
|
25
|
+
placeholder: "0.1.0"
|
|
26
|
+
validations:
|
|
27
|
+
required: true
|
|
28
|
+
- type: input
|
|
29
|
+
id: environment
|
|
30
|
+
attributes:
|
|
31
|
+
label: OS / Python version
|
|
32
|
+
placeholder: "macOS 14 / Python 3.13"
|
|
33
|
+
validations:
|
|
34
|
+
required: true
|
|
35
|
+
- type: textarea
|
|
36
|
+
id: logs
|
|
37
|
+
attributes:
|
|
38
|
+
label: Relevant logs
|
|
39
|
+
render: shell
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
name: Feature request
|
|
2
|
+
description: Suggest an idea for Topolox
|
|
3
|
+
labels: ["enhancement"]
|
|
4
|
+
body:
|
|
5
|
+
- type: textarea
|
|
6
|
+
id: problem
|
|
7
|
+
attributes:
|
|
8
|
+
label: Problem
|
|
9
|
+
description: What problem would this feature solve? What are you trying to do?
|
|
10
|
+
validations:
|
|
11
|
+
required: true
|
|
12
|
+
- type: textarea
|
|
13
|
+
id: proposal
|
|
14
|
+
attributes:
|
|
15
|
+
label: Proposed solution
|
|
16
|
+
description: Describe what you'd like to happen.
|
|
17
|
+
validations:
|
|
18
|
+
required: true
|
|
19
|
+
- type: textarea
|
|
20
|
+
id: alternatives
|
|
21
|
+
attributes:
|
|
22
|
+
label: Alternatives considered
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
## Summary
|
|
2
|
+
|
|
3
|
+
<!-- What does this PR change and why? -->
|
|
4
|
+
|
|
5
|
+
## Related issue
|
|
6
|
+
|
|
7
|
+
<!-- e.g. Closes #123 -->
|
|
8
|
+
|
|
9
|
+
## Checklist
|
|
10
|
+
|
|
11
|
+
- [ ] `uv run ruff check .` passes
|
|
12
|
+
- [ ] `uv run ruff format --check .` passes
|
|
13
|
+
- [ ] `uv run mypy src` passes
|
|
14
|
+
- [ ] `uv run pytest` passes
|
|
15
|
+
- [ ] Added/updated tests where relevant
|
|
16
|
+
- [ ] Updated `CHANGELOG.md` (Unreleased)
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
name: CI
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
push:
|
|
5
|
+
branches: [main]
|
|
6
|
+
pull_request:
|
|
7
|
+
|
|
8
|
+
concurrency:
|
|
9
|
+
group: ci-${{ github.ref }}
|
|
10
|
+
cancel-in-progress: true
|
|
11
|
+
|
|
12
|
+
jobs:
|
|
13
|
+
check:
|
|
14
|
+
runs-on: ubuntu-latest
|
|
15
|
+
strategy:
|
|
16
|
+
fail-fast: false
|
|
17
|
+
matrix:
|
|
18
|
+
python-version: ["3.11", "3.12", "3.13"]
|
|
19
|
+
steps:
|
|
20
|
+
- uses: actions/checkout@v4
|
|
21
|
+
|
|
22
|
+
- name: Install uv
|
|
23
|
+
uses: astral-sh/setup-uv@v5
|
|
24
|
+
with:
|
|
25
|
+
enable-cache: true
|
|
26
|
+
|
|
27
|
+
- name: Set up Python ${{ matrix.python-version }}
|
|
28
|
+
run: uv python install ${{ matrix.python-version }}
|
|
29
|
+
|
|
30
|
+
- name: Install dependencies
|
|
31
|
+
run: uv sync --python ${{ matrix.python-version }}
|
|
32
|
+
|
|
33
|
+
- name: Lint (ruff)
|
|
34
|
+
run: uv run ruff check .
|
|
35
|
+
|
|
36
|
+
- name: Format check (ruff)
|
|
37
|
+
run: uv run ruff format --check .
|
|
38
|
+
|
|
39
|
+
- name: Type check (mypy)
|
|
40
|
+
run: uv run mypy src
|
|
41
|
+
|
|
42
|
+
- name: Test (pytest)
|
|
43
|
+
run: uv run pytest
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
name: Release
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
push:
|
|
5
|
+
tags: ["v*"]
|
|
6
|
+
|
|
7
|
+
jobs:
|
|
8
|
+
release:
|
|
9
|
+
runs-on: ubuntu-latest
|
|
10
|
+
environment: pypi
|
|
11
|
+
permissions:
|
|
12
|
+
id-token: write # required for PyPI trusted publishing (OIDC)
|
|
13
|
+
contents: read
|
|
14
|
+
steps:
|
|
15
|
+
- uses: actions/checkout@v4
|
|
16
|
+
|
|
17
|
+
- name: Install uv
|
|
18
|
+
uses: astral-sh/setup-uv@v5
|
|
19
|
+
|
|
20
|
+
- name: Build distributions
|
|
21
|
+
run: uv build
|
|
22
|
+
|
|
23
|
+
- name: Publish to PyPI
|
|
24
|
+
run: uv publish
|
topolox-0.1.0/.gitignore
ADDED
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
# Topolox data artifacts
|
|
2
|
+
.topolox/
|
|
3
|
+
*.kuzu/
|
|
4
|
+
*.lance/
|
|
5
|
+
|
|
6
|
+
# Python
|
|
7
|
+
__pycache__/
|
|
8
|
+
*.py[cod]
|
|
9
|
+
*.egg-info/
|
|
10
|
+
.eggs/
|
|
11
|
+
build/
|
|
12
|
+
dist/
|
|
13
|
+
|
|
14
|
+
# Environments & tools
|
|
15
|
+
.venv/
|
|
16
|
+
.env
|
|
17
|
+
.mypy_cache/
|
|
18
|
+
.ruff_cache/
|
|
19
|
+
.pytest_cache/
|
|
20
|
+
.coverage
|
|
21
|
+
htmlcov/
|
|
22
|
+
|
|
23
|
+
# OS & editors
|
|
24
|
+
.DS_Store
|
|
25
|
+
*.swp
|
|
26
|
+
.idea/
|
|
27
|
+
.vscode/
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
# Run `uv run pre-commit install` once to enable these hooks.
|
|
2
|
+
repos:
|
|
3
|
+
- repo: https://github.com/astral-sh/ruff-pre-commit
|
|
4
|
+
rev: v0.11.0
|
|
5
|
+
hooks:
|
|
6
|
+
- id: ruff
|
|
7
|
+
args: [--fix]
|
|
8
|
+
- id: ruff-format
|
|
9
|
+
- repo: https://github.com/pre-commit/mirrors-mypy
|
|
10
|
+
rev: v1.13.0
|
|
11
|
+
hooks:
|
|
12
|
+
- id: mypy
|
|
13
|
+
additional_dependencies: [pydantic]
|
|
14
|
+
args: [src]
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
3.13
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
# Changelog
|
|
2
|
+
|
|
3
|
+
All notable changes to this project will be documented in this file.
|
|
4
|
+
|
|
5
|
+
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
|
|
6
|
+
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
|
7
|
+
|
|
8
|
+
## [Unreleased]
|
|
9
|
+
|
|
10
|
+
### Added
|
|
11
|
+
- Multi-language extraction: a config-driven (per-language `LangSpec`) generalized extractor now pulls functions/classes/methods/imports from Python, JavaScript/JSX, TypeScript/TSX, Go, Rust, Java, C, C++, C#, Ruby, PHP, Kotlin, Swift, and Scala; any other tree-sitter-language-pack grammar is parsed and indexed at the file level.
|
|
12
|
+
- Multi-agent `topolox mcp install`: registers the MCP server with Claude Code, Cursor, OpenAI Codex CLI (TOML), Gemini CLI, VS Code (`servers` key), Windsurf, and Claude Desktop, merging existing config.
|
|
13
|
+
- Daemon (Phase 2): incremental `Indexer.update()` (re-parse changed files in-process, content-hash skip, prune stale symbols, handle deletions) and a `watchdog` watcher → debounced async service that patches the graph + vectors in milliseconds. Wired as `topolox daemon` (initial index, then live watch).
|
|
14
|
+
- MCP server (Phase 2): a FastMCP server exposing `get_file_dependencies`, `analyze_blast_radius`, `prune_context`, and `search_architecture_graph` (async, thread-offloaded) to Claude Code / Cursor. `topolox mcp serve` runs it over stdio; `topolox mcp install` writes the client config (`.mcp.json` / `.cursor/mcp.json`). Tested via an in-memory FastMCP client.
|
|
15
|
+
- Query engine (Phase 2): blast-radius simulation (transitive downstream importers), LanceDB vector search, a `FastEmbedEmbedder` (local ONNX embeddings via the `[embeddings]` extra), and a hybrid `ContextPruner` (vector seeds → graph expansion → token-budget cap). Wired as `topolox blast` and `topolox prune`; `topolox index` now uses real embeddings when `fastembed` is installed.
|
|
16
|
+
- Storage & indexing (Phase 1): embedded Kùzu graph store (`Symbol` nodes + `Rel` edges, idempotent MERGE upserts) and LanceDB vector store behind their ports; `Indexer.build()` wiring the parser pool into both stores. `topolox index` now persists to `.topolox/`, and `topolox deps <file>` reports module-level dependencies/dependents.
|
|
17
|
+
- Core parser (Phase 1): gitignore-aware file discovery, tree-sitter symbol/edge extraction (functions, classes, methods, imports), a picklable worker, and a `ProcessPoolExecutor` pool. `topolox index --dry-run` parses a repo and prints node/edge counts.
|
|
18
|
+
- Project scaffold: `src/` layout, packaging (`pyproject.toml`), and tooling (uv, ruff, mypy, pytest).
|
|
19
|
+
- Core data contracts (`SymbolNode`, `Edge`, `ParseResult`, query DTOs) and store ports (`GraphStore`, `VectorStore`, `Embedder`).
|
|
20
|
+
- CLI skeleton (`topolox`) and module stubs for parser, stores, indexer, query, daemon, MCP, and TUI.
|
|
21
|
+
- Open-source project files: README, license, contributing guide, code of conduct, security policy, CI, and issue/PR templates.
|
|
22
|
+
|
|
23
|
+
[Unreleased]: https://github.com/Karnav018/topolox/commits/main
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
# Contributor Covenant Code of Conduct
|
|
2
|
+
|
|
3
|
+
## Our Pledge
|
|
4
|
+
|
|
5
|
+
We as members, contributors, and leaders pledge to make participation in our
|
|
6
|
+
community a harassment-free experience for everyone, regardless of age, body
|
|
7
|
+
size, visible or invisible disability, ethnicity, sex characteristics, gender
|
|
8
|
+
identity and expression, level of experience, education, socio-economic status,
|
|
9
|
+
nationality, personal appearance, race, religion, or sexual identity and
|
|
10
|
+
orientation.
|
|
11
|
+
|
|
12
|
+
We pledge to act and interact in ways that contribute to an open, welcoming,
|
|
13
|
+
diverse, inclusive, and healthy community.
|
|
14
|
+
|
|
15
|
+
## Our Standards
|
|
16
|
+
|
|
17
|
+
Examples of behavior that contributes to a positive environment:
|
|
18
|
+
|
|
19
|
+
- Demonstrating empathy and kindness toward other people
|
|
20
|
+
- Being respectful of differing opinions, viewpoints, and experiences
|
|
21
|
+
- Giving and gracefully accepting constructive feedback
|
|
22
|
+
- Accepting responsibility and apologizing to those affected by our mistakes
|
|
23
|
+
- Focusing on what is best for the overall community
|
|
24
|
+
|
|
25
|
+
Examples of unacceptable behavior:
|
|
26
|
+
|
|
27
|
+
- The use of sexualized language or imagery, and sexual attention or advances
|
|
28
|
+
- Trolling, insulting or derogatory comments, and personal or political attacks
|
|
29
|
+
- Public or private harassment
|
|
30
|
+
- Publishing others' private information without explicit permission
|
|
31
|
+
- Other conduct which could reasonably be considered inappropriate in a
|
|
32
|
+
professional setting
|
|
33
|
+
|
|
34
|
+
## Enforcement Responsibilities
|
|
35
|
+
|
|
36
|
+
Community leaders are responsible for clarifying and enforcing our standards and
|
|
37
|
+
will take appropriate and fair corrective action in response to any behavior
|
|
38
|
+
that they deem inappropriate, threatening, offensive, or harmful.
|
|
39
|
+
|
|
40
|
+
## Scope
|
|
41
|
+
|
|
42
|
+
This Code of Conduct applies within all community spaces, and also applies when
|
|
43
|
+
an individual is officially representing the community in public spaces.
|
|
44
|
+
|
|
45
|
+
## Enforcement
|
|
46
|
+
|
|
47
|
+
Instances of abusive, harassing, or otherwise unacceptable behavior may be
|
|
48
|
+
reported to the community leaders responsible for enforcement at
|
|
49
|
+
`INSERT-CONTACT-EMAIL`. All complaints will be reviewed and investigated
|
|
50
|
+
promptly and fairly.
|
|
51
|
+
|
|
52
|
+
All community leaders are obligated to respect the privacy and security of the
|
|
53
|
+
reporter of any incident.
|
|
54
|
+
|
|
55
|
+
## Attribution
|
|
56
|
+
|
|
57
|
+
This Code of Conduct is adapted from the [Contributor Covenant][homepage],
|
|
58
|
+
version 2.1, available at
|
|
59
|
+
https://www.contributor-covenant.org/version/2/1/code_of_conduct.html.
|
|
60
|
+
|
|
61
|
+
[homepage]: https://www.contributor-covenant.org
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
# Contributing to Topolox
|
|
2
|
+
|
|
3
|
+
Thanks for your interest! Topolox is in early development — see [ROADMAP.md](ROADMAP.md) for the phase plan.
|
|
4
|
+
|
|
5
|
+
## Development setup
|
|
6
|
+
|
|
7
|
+
Topolox uses [uv](https://docs.astral.sh/uv/) for environment and dependency management.
|
|
8
|
+
|
|
9
|
+
```bash
|
|
10
|
+
git clone https://github.com/Karnav018/topolox.git
|
|
11
|
+
cd topolox
|
|
12
|
+
uv sync # creates .venv, installs deps + dev tools
|
|
13
|
+
uv run pre-commit install # optional: enable git hooks
|
|
14
|
+
```
|
|
15
|
+
|
|
16
|
+
The project targets Python 3.11–3.13. `uv` will fetch the pinned interpreter automatically (see `.python-version`).
|
|
17
|
+
|
|
18
|
+
## Before you push
|
|
19
|
+
|
|
20
|
+
All of these run in CI and must pass:
|
|
21
|
+
|
|
22
|
+
```bash
|
|
23
|
+
uv run ruff check . # lint
|
|
24
|
+
uv run ruff format --check . # formatting
|
|
25
|
+
uv run mypy src # static types (strict)
|
|
26
|
+
uv run pytest # tests
|
|
27
|
+
```
|
|
28
|
+
|
|
29
|
+
`uv run ruff check --fix .` and `uv run ruff format .` fix most issues automatically.
|
|
30
|
+
|
|
31
|
+
## Guidelines
|
|
32
|
+
|
|
33
|
+
- **Match the surrounding code** — typing is strict; annotate everything in `src/`.
|
|
34
|
+
- **Keep the engine deterministic.** Graph construction must not call an LLM; the LLM is only used at query time by the consuming agent.
|
|
35
|
+
- **New ports go behind a Protocol.** Storage backends implement `GraphStore` / `VectorStore` (see `src/topolox/graph/store.py`, `src/topolox/vectors/store.py`).
|
|
36
|
+
- **Conventional commits** are appreciated (`feat:`, `fix:`, `docs:`, `refactor:`, `test:`, `chore:`).
|
|
37
|
+
|
|
38
|
+
## Pull requests
|
|
39
|
+
|
|
40
|
+
1. Fork and branch from `main`.
|
|
41
|
+
2. Make your change with tests.
|
|
42
|
+
3. Ensure the checks above pass.
|
|
43
|
+
4. Open a PR describing the change and linking any related issue.
|
|
44
|
+
|
|
45
|
+
By contributing you agree your work is licensed under the project's [MIT License](LICENSE) and that you follow the [Code of Conduct](CODE_OF_CONDUCT.md).
|
topolox-0.1.0/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Karnav and the Topolox contributors
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
topolox-0.1.0/PKG-INFO
ADDED
|
@@ -0,0 +1,129 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: topolox
|
|
3
|
+
Version: 0.1.0
|
|
4
|
+
Summary: The topological memory and architecture layer for AI coding agents.
|
|
5
|
+
Project-URL: Homepage, https://github.com/Karnav018/topolox
|
|
6
|
+
Project-URL: Repository, https://github.com/Karnav018/topolox
|
|
7
|
+
Project-URL: Issues, https://github.com/Karnav018/topolox/issues
|
|
8
|
+
Project-URL: Changelog, https://github.com/Karnav018/topolox/blob/main/CHANGELOG.md
|
|
9
|
+
Author: Karnav
|
|
10
|
+
License-Expression: MIT
|
|
11
|
+
License-File: LICENSE
|
|
12
|
+
Keywords: ai,claude,code-intelligence,coding-agents,cursor,knowledge-graph,kuzu,lancedb,mcp,tree-sitter
|
|
13
|
+
Classifier: Development Status :: 2 - Pre-Alpha
|
|
14
|
+
Classifier: Environment :: Console
|
|
15
|
+
Classifier: Intended Audience :: Developers
|
|
16
|
+
Classifier: Operating System :: OS Independent
|
|
17
|
+
Classifier: Programming Language :: Python :: 3
|
|
18
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
19
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
20
|
+
Classifier: Programming Language :: Python :: 3.13
|
|
21
|
+
Classifier: Topic :: Software Development :: Libraries :: Python Modules
|
|
22
|
+
Classifier: Typing :: Typed
|
|
23
|
+
Requires-Python: >=3.11
|
|
24
|
+
Requires-Dist: fastmcp<4,>=3.4
|
|
25
|
+
Requires-Dist: kuzu==0.11.3
|
|
26
|
+
Requires-Dist: lancedb<0.34,>=0.33
|
|
27
|
+
Requires-Dist: pydantic-settings>=2.3
|
|
28
|
+
Requires-Dist: pydantic>=2.7
|
|
29
|
+
Requires-Dist: textual>=8.2
|
|
30
|
+
Requires-Dist: tree-sitter-language-pack>=1.8
|
|
31
|
+
Requires-Dist: tree-sitter<0.26,>=0.25
|
|
32
|
+
Requires-Dist: typer>=0.12
|
|
33
|
+
Requires-Dist: watchdog>=6
|
|
34
|
+
Provides-Extra: embeddings
|
|
35
|
+
Requires-Dist: fastembed>=0.8; extra == 'embeddings'
|
|
36
|
+
Provides-Extra: llm
|
|
37
|
+
Requires-Dist: anthropic>=0.105; extra == 'llm'
|
|
38
|
+
Description-Content-Type: text/markdown
|
|
39
|
+
|
|
40
|
+
# Topolox
|
|
41
|
+
|
|
42
|
+
> **The topological memory and architecture layer for AI coding agents.**
|
|
43
|
+
|
|
44
|
+
[](https://github.com/Karnav018/topolox/actions/workflows/ci.yml)
|
|
45
|
+
[](https://www.python.org/)
|
|
46
|
+
[](LICENSE)
|
|
47
|
+
[](ROADMAP.md)
|
|
48
|
+
|
|
49
|
+
Topolox gives AI coding agents (Claude Code, Cursor) **instant, deep understanding of large codebases**. Instead of burning tokens reading thousands of files, it feeds an agent exactly the context it needs using an embedded **hybrid graph + vector engine** — kept live by a background daemon and exposed over **MCP** and an optional terminal cockpit.
|
|
50
|
+
|
|
51
|
+
> ⚠️ **Pre-alpha.** The scaffold and contracts are in place; the engine is being built phase by phase. See [ROADMAP.md](ROADMAP.md).
|
|
52
|
+
|
|
53
|
+
## Why
|
|
54
|
+
|
|
55
|
+
On a big repo, an AI agent is *smart but blind*: it either reads dozens of files (slow, expensive) or misses a downstream caller and breaks something. Topolox is the **memory + map** the agent reads from — deterministic, instantly rebuildable, and zero-token to build.
|
|
56
|
+
|
|
57
|
+
## How it works
|
|
58
|
+
|
|
59
|
+
```
|
|
60
|
+
discover → parse (multiprocessing tree-sitter) → ParseResult
|
|
61
|
+
→ index → Kùzu (graph) + LanceDB (vectors)
|
|
62
|
+
→ query (dependencies · context pruner · blast radius)
|
|
63
|
+
→ MCP tools + CLI + Textual TUI
|
|
64
|
+
┌ watchdog daemon patches the graph live on every file save ┐
|
|
65
|
+
```
|
|
66
|
+
|
|
67
|
+
## Topolox vs. Graphify
|
|
68
|
+
|
|
69
|
+
Graphify pioneered "drop in a folder, get a knowledge graph." Topolox takes that idea in a different direction: an **always-on, agent-native engine for code**. They're built for different jobs.
|
|
70
|
+
|
|
71
|
+
| | **Graphify** | **Topolox** |
|
|
72
|
+
| :--- | :--- | :--- |
|
|
73
|
+
| **Form factor** | A Claude Code *skill* (`/graphify`) | A standalone *service*: CLI + MCP server + daemon |
|
|
74
|
+
| **Graph build** | AST **+ LLM extraction** (Claude subagents / Gemini) | **Pure deterministic** AST (multiprocessing tree-sitter) |
|
|
75
|
+
| **When the LLM runs** | At **build** time — spends tokens on every build | Only at **query** time (the consuming agent); build is **zero-token** |
|
|
76
|
+
| **Storage** | Static `graph.json` + in-memory NetworkX | Embedded **Kùzu** (graph) + **LanceDB** (vectors), on disk |
|
|
77
|
+
| **Retrieval** | Lexical substring + IDF + BFS/DFS traversal | **Vector** semantic search + graph traversal (hybrid) |
|
|
78
|
+
| **Live updates** | Opt-in `--watch` / git hook / manual `--update` | **watchdog daemon**, ms-level incremental patches |
|
|
79
|
+
| **Agent access** | Optional MCP (7 read-only tools) + Markdown reports | **MCP-native** (4 tools), `mcp install` for every agent |
|
|
80
|
+
| **Inputs** | Code **+ docs + papers + images + video** | Code — 14 languages richly, 300+ at the file level |
|
|
81
|
+
| **Signature features** | Community detection, "god nodes", multi-modal RAG | Blast radius, dependency maps, context pruner |
|
|
82
|
+
| **Concurrency** | Single graph, in-memory | Multiprocessing + asyncio, embedded DBs |
|
|
83
|
+
|
|
84
|
+
**In short:** Graphify is a broad, **multi-modal, LLM-enriched** knowledge-graph builder you invoke as a skill — its graph is *richer* on inferred relationships. Topolox is a narrow, **deterministic, zero-token, always-live code engine** that any MCP agent reads from — *faster, cheaper, and instantly rebuildable*. That's the trade Topolox makes to be an always-on backend.
|
|
85
|
+
|
|
86
|
+
## Two ways to use it
|
|
87
|
+
|
|
88
|
+
1. **Invisible backend (MCP).** Index once, register with your agent, and any MCP client silently pulls grounded, cheap context.
|
|
89
|
+
```bash
|
|
90
|
+
topolox index .
|
|
91
|
+
topolox mcp install # registers with Claude Code, Cursor, Codex, Gemini CLI, VS Code, ...
|
|
92
|
+
topolox daemon # keep the graph live in the background
|
|
93
|
+
```
|
|
94
|
+
2. **The TUI cockpit** *(planned — Phase 3).* A 3-pane terminal dashboard (agent chat · live knowledge graph · daemon log), `topolox ui`. See [ROADMAP.md](ROADMAP.md).
|
|
95
|
+
|
|
96
|
+
## Supported languages & agents
|
|
97
|
+
|
|
98
|
+
**Languages** — symbol + import extraction for Python, JavaScript/JSX, TypeScript/TSX, Go, Rust, Java, C, C++, C#, Ruby, PHP, Kotlin, Swift, and Scala; any other [tree-sitter-language-pack](https://github.com/Goldziher/tree-sitter-language-pack) grammar (300+) is still parsed and indexed at the file level.
|
|
99
|
+
|
|
100
|
+
**Agents** — `topolox mcp install` registers the MCP server with **Claude Code, Cursor, OpenAI Codex CLI, Gemini CLI, VS Code, Windsurf, and Claude Desktop** (and any other MCP client — it's a standard stdio MCP server).
|
|
101
|
+
|
|
102
|
+
## Install (from source)
|
|
103
|
+
|
|
104
|
+
```bash
|
|
105
|
+
git clone https://github.com/Karnav018/topolox.git
|
|
106
|
+
cd topolox
|
|
107
|
+
uv sync
|
|
108
|
+
uv run topolox --help
|
|
109
|
+
```
|
|
110
|
+
|
|
111
|
+
## Development
|
|
112
|
+
|
|
113
|
+
```bash
|
|
114
|
+
uv sync # create the env + install dev tools
|
|
115
|
+
uv run ruff check . # lint
|
|
116
|
+
uv run ruff format . # format
|
|
117
|
+
uv run mypy src # type-check (strict)
|
|
118
|
+
uv run pytest # tests
|
|
119
|
+
```
|
|
120
|
+
|
|
121
|
+
See [CONTRIBUTING.md](CONTRIBUTING.md). Contributions welcome once the engine lands.
|
|
122
|
+
|
|
123
|
+
## Tech stack
|
|
124
|
+
|
|
125
|
+
Python 3.11+ · [Kùzu](https://kuzudb.com) (graph) · [LanceDB](https://lancedb.com) (vectors) · [tree-sitter](https://tree-sitter.github.io) (AST) · [FastMCP](https://gofastmcp.com) (MCP server) · [watchdog](https://github.com/gorakhargosh/watchdog) (daemon) · [Textual](https://textual.textualize.io) (TUI) · [Typer](https://typer.tiangolo.com) (CLI). Optional: `fastembed` (local embeddings), `anthropic` (TUI chat).
|
|
126
|
+
|
|
127
|
+
## License
|
|
128
|
+
|
|
129
|
+
[MIT](LICENSE)
|
topolox-0.1.0/README.md
ADDED
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
# Topolox
|
|
2
|
+
|
|
3
|
+
> **The topological memory and architecture layer for AI coding agents.**
|
|
4
|
+
|
|
5
|
+
[](https://github.com/Karnav018/topolox/actions/workflows/ci.yml)
|
|
6
|
+
[](https://www.python.org/)
|
|
7
|
+
[](LICENSE)
|
|
8
|
+
[](ROADMAP.md)
|
|
9
|
+
|
|
10
|
+
Topolox gives AI coding agents (Claude Code, Cursor) **instant, deep understanding of large codebases**. Instead of burning tokens reading thousands of files, it feeds an agent exactly the context it needs using an embedded **hybrid graph + vector engine** — kept live by a background daemon and exposed over **MCP** and an optional terminal cockpit.
|
|
11
|
+
|
|
12
|
+
> ⚠️ **Pre-alpha.** The scaffold and contracts are in place; the engine is being built phase by phase. See [ROADMAP.md](ROADMAP.md).
|
|
13
|
+
|
|
14
|
+
## Why
|
|
15
|
+
|
|
16
|
+
On a big repo, an AI agent is *smart but blind*: it either reads dozens of files (slow, expensive) or misses a downstream caller and breaks something. Topolox is the **memory + map** the agent reads from — deterministic, instantly rebuildable, and zero-token to build.
|
|
17
|
+
|
|
18
|
+
## How it works
|
|
19
|
+
|
|
20
|
+
```
|
|
21
|
+
discover → parse (multiprocessing tree-sitter) → ParseResult
|
|
22
|
+
→ index → Kùzu (graph) + LanceDB (vectors)
|
|
23
|
+
→ query (dependencies · context pruner · blast radius)
|
|
24
|
+
→ MCP tools + CLI + Textual TUI
|
|
25
|
+
┌ watchdog daemon patches the graph live on every file save ┐
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
## Topolox vs. Graphify
|
|
29
|
+
|
|
30
|
+
Graphify pioneered "drop in a folder, get a knowledge graph." Topolox takes that idea in a different direction: an **always-on, agent-native engine for code**. They're built for different jobs.
|
|
31
|
+
|
|
32
|
+
| | **Graphify** | **Topolox** |
|
|
33
|
+
| :--- | :--- | :--- |
|
|
34
|
+
| **Form factor** | A Claude Code *skill* (`/graphify`) | A standalone *service*: CLI + MCP server + daemon |
|
|
35
|
+
| **Graph build** | AST **+ LLM extraction** (Claude subagents / Gemini) | **Pure deterministic** AST (multiprocessing tree-sitter) |
|
|
36
|
+
| **When the LLM runs** | At **build** time — spends tokens on every build | Only at **query** time (the consuming agent); build is **zero-token** |
|
|
37
|
+
| **Storage** | Static `graph.json` + in-memory NetworkX | Embedded **Kùzu** (graph) + **LanceDB** (vectors), on disk |
|
|
38
|
+
| **Retrieval** | Lexical substring + IDF + BFS/DFS traversal | **Vector** semantic search + graph traversal (hybrid) |
|
|
39
|
+
| **Live updates** | Opt-in `--watch` / git hook / manual `--update` | **watchdog daemon**, ms-level incremental patches |
|
|
40
|
+
| **Agent access** | Optional MCP (7 read-only tools) + Markdown reports | **MCP-native** (4 tools), `mcp install` for every agent |
|
|
41
|
+
| **Inputs** | Code **+ docs + papers + images + video** | Code — 14 languages richly, 300+ at the file level |
|
|
42
|
+
| **Signature features** | Community detection, "god nodes", multi-modal RAG | Blast radius, dependency maps, context pruner |
|
|
43
|
+
| **Concurrency** | Single graph, in-memory | Multiprocessing + asyncio, embedded DBs |
|
|
44
|
+
|
|
45
|
+
**In short:** Graphify is a broad, **multi-modal, LLM-enriched** knowledge-graph builder you invoke as a skill — its graph is *richer* on inferred relationships. Topolox is a narrow, **deterministic, zero-token, always-live code engine** that any MCP agent reads from — *faster, cheaper, and instantly rebuildable*. That's the trade Topolox makes to be an always-on backend.
|
|
46
|
+
|
|
47
|
+
## Two ways to use it
|
|
48
|
+
|
|
49
|
+
1. **Invisible backend (MCP).** Index once, register with your agent, and any MCP client silently pulls grounded, cheap context.
|
|
50
|
+
```bash
|
|
51
|
+
topolox index .
|
|
52
|
+
topolox mcp install # registers with Claude Code, Cursor, Codex, Gemini CLI, VS Code, ...
|
|
53
|
+
topolox daemon # keep the graph live in the background
|
|
54
|
+
```
|
|
55
|
+
2. **The TUI cockpit** *(planned — Phase 3).* A 3-pane terminal dashboard (agent chat · live knowledge graph · daemon log), `topolox ui`. See [ROADMAP.md](ROADMAP.md).
|
|
56
|
+
|
|
57
|
+
## Supported languages & agents
|
|
58
|
+
|
|
59
|
+
**Languages** — symbol + import extraction for Python, JavaScript/JSX, TypeScript/TSX, Go, Rust, Java, C, C++, C#, Ruby, PHP, Kotlin, Swift, and Scala; any other [tree-sitter-language-pack](https://github.com/Goldziher/tree-sitter-language-pack) grammar (300+) is still parsed and indexed at the file level.
|
|
60
|
+
|
|
61
|
+
**Agents** — `topolox mcp install` registers the MCP server with **Claude Code, Cursor, OpenAI Codex CLI, Gemini CLI, VS Code, Windsurf, and Claude Desktop** (and any other MCP client — it's a standard stdio MCP server).
|
|
62
|
+
|
|
63
|
+
## Install (from source)
|
|
64
|
+
|
|
65
|
+
```bash
|
|
66
|
+
git clone https://github.com/Karnav018/topolox.git
|
|
67
|
+
cd topolox
|
|
68
|
+
uv sync
|
|
69
|
+
uv run topolox --help
|
|
70
|
+
```
|
|
71
|
+
|
|
72
|
+
## Development
|
|
73
|
+
|
|
74
|
+
```bash
|
|
75
|
+
uv sync # create the env + install dev tools
|
|
76
|
+
uv run ruff check . # lint
|
|
77
|
+
uv run ruff format . # format
|
|
78
|
+
uv run mypy src # type-check (strict)
|
|
79
|
+
uv run pytest # tests
|
|
80
|
+
```
|
|
81
|
+
|
|
82
|
+
See [CONTRIBUTING.md](CONTRIBUTING.md). Contributions welcome once the engine lands.
|
|
83
|
+
|
|
84
|
+
## Tech stack
|
|
85
|
+
|
|
86
|
+
Python 3.11+ · [Kùzu](https://kuzudb.com) (graph) · [LanceDB](https://lancedb.com) (vectors) · [tree-sitter](https://tree-sitter.github.io) (AST) · [FastMCP](https://gofastmcp.com) (MCP server) · [watchdog](https://github.com/gorakhargosh/watchdog) (daemon) · [Textual](https://textual.textualize.io) (TUI) · [Typer](https://typer.tiangolo.com) (CLI). Optional: `fastembed` (local embeddings), `anthropic` (TUI chat).
|
|
87
|
+
|
|
88
|
+
## License
|
|
89
|
+
|
|
90
|
+
[MIT](LICENSE)
|