Open Source
Explore the latest AI open-source projects from GitHub and HuggingFace.
Explore the latest AI open-source projects from GitHub and HuggingFace.
**Graft** is NanoNets' answer to a cost most teams have stopped noticing: every coding-agent task begins by re-exploring the same repository. The agent greps a term, opens a file, follows an import, backs out, tries again — rebuilding a picture of a codebase it mapped an hour ago and threw away. Graft builds that picture **once**, writes it into the repo as a folder of linked markdown files, and lets the agent read it instead. Released under **MIT** and written in **TypeScript**, the repository has collected **3,775 stars and 335 forks** since its **3 July 2026** creation, and the `@nanonets/graft` npm package recorded **13,358 downloads** in the 30 days ending 18 August 2026. The structure is a graph, not an index. A node is a single markdown file holding a plain-English summary of what a subsystem does, a **crux** — the handful of lines that actually carry the logic, lifted from the source and stored inline — the content-hashed files it was built from, and typed `[[wikilink]]` connections (`depends_on`, `part_of`, `uses`, `implements`, `produces`) the agent can follow. There are no embeddings and no similarity search: the agent opens, greps and follows these files exactly the way it reads any other file in the repo. Anything a developer writes below the generated block survives regeneration. The split between what is free and what costs money is the design's load-bearing decision. Tier 1 is **pure tree-sitter** — every function, class and call edge, deterministic, no model and no API key — which is why plain `graft build` needs no credentials at all. The LLM-written parts are opt-in behind `graft build --deep`, and they run through whichever provider the operator configures: an OpenAI-compatible endpoint, Anthropic's native API, OpenRouter, Fireworks, Groq, a LiteLLM proxy or a local server, under the user's own key. Language coverage is **21 languages** at two fidelities — hand-written scope-aware extractors for TypeScript/JavaScript, Python, Go and Java, plus a broad tree-sitter tier covering Rust, C, C++, C#, Ruby, PHP, Kotlin, Swift, Zig and more — with opt-in `--lsp` edges when rust-analyzer, clangd, gopls, pyright or typescript-language-server is on `PATH`. Staleness is handled by making the refresh too cheap to skip. Every pass is cached by content hash, so a rebuild touches only changed files (the project reports 0.74s cold and 0.18s after one edit on its own 124-file tree), and each query stats the working tree against the last build's fingerprint in roughly 3ms before answering. Freshness compares working-tree bytes rather than commit or index state, so uncommitted, unstaged and staged edits all look the same to Graft. The refresh is structural and never calls the model. On results, the project measured two different things and reports both. A **162-run controlled sweep** across two repos found the Graft-fed agent used **46% fewer tool calls, 42% fewer tokens and 60% less wall-clock time**, with correctness **unchanged at 93% on both arms**; a separate pull-based variant traded most of that speed for 98% correctness. The correctness gain quoted in the header comes from elsewhere — **SWE-bench Verified, 50 instances**, same Claude Sonnet 5 model on both arms, graded by the official `swebench` harness, where Graft resolved **33 of 50 (66%)** against a cold baseline's **27 of 50 (54%)** while using 23% fewer tokens. Reading the two together is the honest version: the speed claim is broadly supported, and the correctness claim rests on a 50-instance benchmark run rather than the larger sweep. Integration is a single `graft init`, which detects installed agents and writes each one's native instruction file — `AGENTS.md`, `GEMINI.md`, Copilot instructions, or an owned rule file for Claude Code, Cursor, Kiro and Windsurf — registers an **MCP server exposing six tools**, and installs post-edit hooks. It is idempotent, marker-fenced, and never touches `CLAUDE.md`. The honest caveats: `init` can write **machine-wide** entries into `~/.codex/` when that directory exists (labelled in the picker, skippable with `--no-global`), the crux currently ships in the per-symbol code graph rather than inlined into markdown nodes, and the benchmark numbers are the vendor's own harness on two repositories.