Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
61 commits
Select commit Hold shift + click to select a range
b1a58d9
[DRAFT] Add search-index algorithm
hungpham7-tiki Aug 2, 2026
07ed476
Refactor the logic to push syntax into graph
hungpham7-tiki Aug 4, 2026
da17284
Show progress bar
hungpham10 Aug 4, 2026
7a10916
Merge pull request #1 from hungpham10/feature/replace-bfs-with-search…
hungpham10 Aug 4, 2026
249f9a8
Refactor logic and add new MCP tools (#2)
hungpham10 Aug 6, 2026
a029afd
Implement new storage to improve performance (#3)
hungpham10 Aug 7, 2026
40c4ac9
Implement to support with claude desktop (#4)
hungpham10 Aug 10, 2026
5bb721f
Finetune to reduce LLM token (#5)
hungpham10 Aug 12, 2026
bbe1274
Implement new MCP http server to support as GA service and new storag…
hungpham10 Aug 15, 2026
bbf2cd0
Implement new embed vector and similar search (#7)
hungpham10 Aug 16, 2026
eedc0c4
Create SECURITY.md for security policy (#8)
hungpham10 Aug 16, 2026
18e09e7
Improve performance by adding lru caching
hungpham10 Aug 17, 2026
40c485e
Fix slowness issue in stats and issue with C#
hungpham10 Aug 18, 2026
40240ea
Fix lint
hungpham10 Aug 18, 2026
8f3ea97
Truncate APIs and support graphql with mermaid (#10)
hungpham10 Aug 19, 2026
568ae6b
Support installing to windows (#11)
hungpham10 Aug 19, 2026
f693345
Release package to MacOS, Linux and Windows (#12)
hungpham10 Aug 20, 2026
8234e95
Bump version to v2.0.0, breaking change from the old repository
hungpham10 Aug 20, 2026
aadee60
Fix issue with different environment
hungpham10 Aug 20, 2026
262e83d
Disable fastembed
hungpham10 Aug 20, 2026
c40bc71
Disable codegraph-bench
hungpham10 Aug 20, 2026
cc6f25f
Bump version to v2.0.1
hungpham10 Aug 20, 2026
84db1a6
Bump version to v2.0.2
hungpham10 Aug 20, 2026
5975023
Setup code-coverage for CI to keep unit test always cover as much sou…
hungpham10 Aug 20, 2026
161abab
Fix CI cannot release signing files
hungpham10 Aug 20, 2026
1a9001d
Fix CI cannot release signing files
hungpham10 Aug 20, 2026
21294a2
Fix CI cannot release signing files
hungpham10 Aug 20, 2026
0e4cc07
Fix CI cannot release signing files
hungpham10 Aug 20, 2026
e14cdd9
Fix CI cannot release signing files
hungpham10 Aug 20, 2026
3b302cb
Show correct readme and installation in linux/windows
hungpham10 Aug 20, 2026
53953d9
Update README and document (#14)
hungpham10 Aug 21, 2026
35c96d5
Update README.MD and detail documents (#15)
hungpham10 Aug 21, 2026
ecaaa4b
Update badge ko-fi
hungpham10 Aug 21, 2026
2ebe558
Disable watcher (#17)
hungpham10 Aug 31, 2026
a2b3434
Bump version to v2.0.5 and fix lint
hungpham10 Aug 31, 2026
c1354fb
style: apply rustfmt
hungpham10 Aug 31, 2026
a7c46c5
Improve code to be more maintainable (#18)
hungpham10 Sep 4, 2026
e9a7597
Bump version to 2.0.6
hungpham10 Sep 4, 2026
b1d210d
Integrate with radare2 to build graph from binary
hungpham10 Sep 6, 2026
0dd119d
Fix issue cannot recognize and link lambda functions (#20)
hungpham10 Sep 6, 2026
503075a
Bump version to 2.1.0
hungpham10 Sep 6, 2026
32b0723
Fix issue crash when analyzing binary and missing symbol function (#21)
hungpham10 Sep 7, 2026
152c936
Improve by showing more meaningful object naming from r2 (#22)
hungpham10 Sep 7, 2026
cec0539
Bump version to v2.1.2
hungpham10 Sep 7, 2026
ca11282
Implement logic to convert structure documents into graph (#23)
hungpham10 Sep 10, 2026
5080680
Integrate codegraph-docs into main flow (#24)
hungpham10 Sep 11, 2026
58b0794
Persistent document graph into disk (#25)
hungpham10 Sep 12, 2026
16a7734
Split storage of binary graph into different database (#26)
hungpham10 Sep 12, 2026
4f0dfa4
Support YAML multiple files (#27)
hungpham10 Sep 12, 2026
b1d6a3d
Show progress bar while indexing documents and improve performance (#28)
hungpham10 Sep 12, 2026
6a75ca7
Restructure to make document be able to trace by llm (#29)
hungpham10 Sep 12, 2026
457db80
Add fuzzy key match, pattern mining (P#) and IDF ranking to document …
hungpham10 Sep 12, 2026
650194a
Fix binary callees/callers/flow always empty: route id >= bin_base to…
hungpham10 Sep 12, 2026
93abbc5
Make binary e2e test resilient to flaky r2 analysis
hungpham10 Sep 13, 2026
2e7f071
Rename MCP tools to graphcode/graphdoc/graphbin families (v2.2.0)
hungpham10 Sep 13, 2026
f00967f
style: apply rustfmt
hungpham10 Sep 13, 2026
580722a
Update graphql to support new models (#32)
hungpham10 Sep 13, 2026
fe8c29f
Fix issue of unittest with radare in linux (#33)
hungpham10 Sep 13, 2026
8ce436c
Add subcommand clean and remove unused commands (#34)
hungpham10 Sep 16, 2026
5e740d6
Add resume-able functions to avoid hanging
hungpham10 Sep 17, 2026
e066a32
Optimize cost by compressing response from MCP
hungpham10 Sep 17, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions .agents/AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,13 +27,13 @@ Always prefer `codegraph` tools for **structural** questions — tracing call hi

| Intent / Question | Recommended MCP Tool |
| :--- | :--- |
| *"Where is symbol X defined?"* | `codegraph_search` |
| *"Where is symbol X defined?"* | `codegraph_search_symbol` |
| *"What callers invoke function Y?"* | `codegraph_callers` |
| *"What methods or functions does Y call?"* | `codegraph_callees` |
| *"What components or files will break if I modify Z?"* | `codegraph_impact` |
| *"Show me Y's exact signature and internal block"* | `codegraph_node` |
| *"Show me Y's exact signature and internal block"* | `codegraph_symbol` |
| *"Give me focused, aggregated context for this task"* | `codegraph_context` |
| *"What files exist under a specific path/ directory?"* | `codegraph_files` |
| *"What files exist under a specific path/ directory?"* | `codegraph_graphcode_files` |
| *"Is the local knowledge graph healthy and active?"* | `codegraph_status` |

---
Expand Down
1 change: 1 addition & 0 deletions .github/FUNDING.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
ko-fi: hungpham55178
37 changes: 37 additions & 0 deletions .github/benches/fetch_repos.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
#!/usr/bin/env bash
# Fetch danh sách repo (pinned) trong .github/benches/repos/sources.txt về
# .github/benches/repos/checkout/<name>, rồi ghi đường dẫn TUYỆT ĐỐI vào
# .github/benches/repos/list.txt để codegraph-bench (CodSpeed) đọc qua env
# CODEGRAPH_BENCH_REPOS_LIST (${{ github.workspace }}/.github/benches/repos/list.txt).
#
# Chạy local: bash .github/benches/fetch_repos.sh
# Chạy trong CI (codspeed.yml) trước `cargo codspeed build`.
set -euo pipefail

DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
OUT="$DIR/repos/checkout"
LIST="$DIR/repos/list.txt"
SRC="$DIR/repos/sources.txt"

mkdir -p "$OUT"
: > "$LIST"

# Mỗi dòng: <name>|<url>|<commit>
# `|| [ -n "$name" ]` xử lý dòng cuối không có trailing `\n`.
while IFS='|' read -r name url commit || [ -n "$name" ]; do
name="$(printf '%s' "$name" | xargs)" # trim
[ -z "$name" ] && continue
[[ "$name" == \#* ]] && continue
dest="$OUT/$name"
if [ ! -d "$dest/.git" ]; then
echo ">> clone $name ..."
git clone --quiet --filter=blob:none --no-checkout "$url" "$dest"
fi
echo ">> checkout $name @ ${commit:0:12}"
git -C "$dest" fetch --quiet --depth 1 origin "$commit"
git -C "$dest" checkout --quiet "$commit"
echo "$dest" >> "$LIST"
done < "$SRC"

echo "=== repos ready (${LIST}) ==="
cat "$LIST"
11 changes: 11 additions & 0 deletions .github/benches/repos/sources.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# Danh sách repo codspeed để benchmark — mỗi dòng: <name>|<git-url>|<commit-sha>
#
# Sửa/thêm dòng để thay đổi tập repo (được fetch về theo `benches/fetch_repos.sh`).
# Commit SHA cố định (pinned) để dữ liệu đầu vào giữ nguyên giữa các lần chạy,
# giúp CodSpeed so sánh performance ổn định. Muốn cập nhật thì đổi SHA rồi re-run.
#
# Các repo nhỏ, đa ngôn ngữ để phủ parser của codegraph-extract:
hello|https://github.com/golang/example|7f05d217867b2af52b0a28c6d1c91df97e1b5b39
serde-json|https://github.com/serde-rs/json|a3e9758ffc88247ab82182cb2505867768a702e3
flask|https://github.com/pallets/flask|6a2f545bfd8ed31e19066a299296917e034aca58
express|https://github.com/expressjs/express|a3714473feb3d2908add734d340e7755fd85e0a3
120 changes: 116 additions & 4 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@ on:
push:
branches: [main]
pull_request:
workflow_dispatch:

permissions:
contents: read

env:
CARGO_TERM_COLOR: always
Expand All @@ -20,25 +24,133 @@ jobs:
components: clippy
- uses: Swatinem/rust-cache@v2
- run: cargo clippy --workspace --all-targets -- -D warnings
- run: cargo clippy -p codegraph-graph --features postgres,mysql,redis --tests -- -D warnings

clippy-windows:
name: clippy (windows)
runs-on: windows-latest
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
with:
components: clippy
targets: x86_64-pc-windows-msvc
- uses: Swatinem/rust-cache@v2
- run: cargo clippy -p codegraph --target x86_64-pc-windows-msvc -- -D warnings

test-windows:
name: test (windows)
runs-on: windows-latest
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
with:
targets: x86_64-pc-windows-msvc
- uses: Swatinem/rust-cache@v2
- name: Build
run: cargo build -p codegraph
- name: Build (fastembed feature)
run: cargo build -p codegraph --features fastembed
- name: Test (binary crate)
run: cargo test -p codegraph
- name: Test (graph crate, sqlite/lmdb backends)
run: cargo test -p codegraph-graph --features sqlite,lmdb,bloom-search
- name: Smoke (doctor + help)
run: |
cargo run -p codegraph -- --help
cargo run -p codegraph -- doctor

test:
name: test (${{ matrix.os }})
runs-on: ${{ matrix.os }}
services:
redis:
image: redis:7-alpine
ports: ["6379:6379"]
options: --health-cmd "redis-cli ping" --health-interval 10s --health-timeout 5s --health-retries 3
postgres:
image: postgres:16-alpine
env:
POSTGRES_USER: postgres
POSTGRES_PASSWORD: postgres
POSTGRES_DB: codegraph
ports: ["5432:5432"]
options: --health-cmd "pg_isready -U postgres" --health-interval 10s --health-timeout 5s --health-retries 3
mysql:
image: mysql:8
env:
MYSQL_ROOT_PASSWORD: postgres
MYSQL_DATABASE: codegraph
ports: ["3306:3306"]
options: --health-cmd "mysqladmin ping -h 127.0.0.1 -u root -ppostgres" --health-interval 10s --health-timeout 5s --health-retries 3
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
os: [ubuntu-latest]
steps:
- uses: actions/checkout@v6
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
with:
components: llvm-tools-preview
- uses: Swatinem/rust-cache@v2
- run: cargo test --workspace --no-fail-fast
- name: Install DB clients
run: sudo apt-get update && sudo apt-get install -y postgresql-client mysql-client
- name: Install radare2 (binary analysis integration tests)
run: sudo apt-get install -y radare2
- name: Apply schema (postgres)
run: |
psql "postgres://postgres:postgres@127.0.0.1:5432/codegraph" -f sql/postgres/001-initial-schema.sql
psql "postgres://postgres:postgres@127.0.0.1:5432/codegraph" -f sql/postgres/002-add-repos-registry.sql
- name: Apply schema (mysql)
run: |
mysql -h 127.0.0.1 -P 3306 -u root -ppostgres codegraph < sql/mysql/001-initial-schema.sql
mysql -h 127.0.0.1 -P 3306 -u root -ppostgres codegraph < sql/mysql/002-add-repos-registry.sql
- name: Install cargo-llvm-cov
uses: taiki-e/install-action@cargo-llvm-cov
- name: Clean coverage data
run: cargo llvm-cov clean --workspace
- name: Run tests with coverage
env:
RUSTFLAGS: "-Cinstrument-coverage"
run: cargo llvm-cov test --workspace --no-fail-fast --no-report
- name: Storage integration tests (postgres)
env:
RUSTFLAGS: "-Cinstrument-coverage"
TEST_RDBMS_DSN: "postgres://postgres:postgres@127.0.0.1:5432/codegraph"
TEST_RDBMS_REPO_ID: "1"
run: cargo llvm-cov test -p codegraph-graph --features postgres --test rdbms --no-report -- --ignored --nocapture --test-threads=1
- name: Storage integration tests (mysql)
env:
RUSTFLAGS: "-Cinstrument-coverage"
TEST_RDBMS_DSN: "mysql://root:postgres@127.0.0.1:3306/codegraph"
TEST_RDBMS_REPO_ID: "1"
run: cargo llvm-cov test -p codegraph-graph --features mysql --test rdbms --no-report -- --ignored --nocapture --test-threads=1
- name: Storage integration tests (redis)
env:
RUSTFLAGS: "-Cinstrument-coverage"
TEST_REDIS_DSN: "redis://127.0.0.1:6379"
run: cargo llvm-cov test -p codegraph-graph --features redis --test redis --no-report -- --ignored --nocapture
- name: Binary integration tests (radare2)
run: cargo llvm-cov test -p codegraph-binary --test extract --no-report -- --ignored --nocapture
- name: Generate coverage report (lcov)
run: |
mkdir -p ./target/coverage
cargo llvm-cov report --lcov --output-path ./target/coverage/lcov.info

- name: Upload to Codecov
uses: codecov/codecov-action@v5
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
with:
files: ./target/coverage/lcov.info
verbose: true
fail_ci_if_error: false

slim:
name: slim build (no visualize)
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
with:
components: clippy
Expand Down
52 changes: 52 additions & 0 deletions .github/workflows/codspeed.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
name: CodSpeed

on:
push:
branches:
- "main"
pull_request:
# `workflow_dispatch` cho phép CodSpeed trigger backtest performance
# để sinh dữ liệu ban đầu.
workflow_dispatch:

permissions:
contents: read
id-token: write # OpenID Connect auth với CodSpeed

env:
# Danh sách repo (1 path/dòng) sẽ được bench — do .github/benches/fetch_repos.sh
# ghi ra từ .github/benches/repos/sources.txt. codegraph-bench đọc env này khi chạy.
# Dùng path TUYỆT ĐỐI để không phụ thuộc CWD của `cargo codspeed run`.
CODEGRAPH_BENCH_REPOS_LIST: ${{ github.workspace }}/.github/benches/repos/list.txt

jobs:
# Performance benchmarks: extract → index → query trên danh sách repo thật
# (xem crates/codegraph-bench, bench target `codspeed`).
codspeed:
name: Bench
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- name: Setup rust toolchain, cache and cargo-codspeed binary
uses: moonrepo/setup-rust@v0
with:
channel: stable
cache-target: release
bins: cargo-codspeed

# Clone các repo pinned trong benches/repos/sources.txt về
# benches/repos/checkout/ và ghi benches/repos/list.txt.
- name: Fetch bench repos
run: bash .github/benches/fetch_repos.sh

- name: Build benchmark targets
run: cargo codspeed build -p codegraph-bench --features codspeed

# `mode: benchmark` đẩy kết quả lên CodSpeed Cloud (auto-provision bằng OIDC)
# để theo dõi trend. Muốn chạy khô (không lưu baseline) thì đổi `simulation`.
- name: Run benchmarks
uses: CodSpeedHQ/action@v4
with:
mode: simulation
run: cargo codspeed run
Loading