Skip to main content
Glama

Documentation · Quickstart · Commands · Privacy · Roadmap

npx @setsu-ai/cli init                 # detect agents, build the graph, wire up MCP
setsu context "How does auth work?"    # token-budgeted evidence, not the whole repo

Available on npm as @setsu-ai/cli · latest version 0.1.0-beta.1 (2026-09-08) · for Claude Code, Codex, Cursor, Copilot and Kiro


🧠 What is SETSU?

AI coding agents rediscover your repository from raw files on every task: grep, read, re-read, repeat. That loop burns your context window and your money.

SETSU builds a persistent code graph of your repository once (tree-sitter parse → symbols and typed edges → PageRank and communities → SQLite), keeps it fresh incrementally, and answers questions with token-budgeted evidence packs — the smallest set of signatures, snippets, and graph paths that answers the question, with provenance on every edge.

  • 🗺️ Persistent code graph — symbols, calls, imports, implements, tests; typed and provenance-labeled

  • 🎯 Token-budgeted retrieval — every pack has a hard budget; a greedy value/cost packer fills it

  • 🔀 Adaptive routing — graph traversal, lexical FTS, repo map, or hybrid, chosen per task

  • Incremental — content-addressed cache; unchanged files are never reparsed

  • 🔌 MCP-native — five tools, stdio only, no network listener

  • 📉 Instruction doctor — measures what your CLAUDE.md/rules actually cost per session

  • 🧪 Learns locally — which strategy works for which task class, on your machine only

  • 🔒 No API key. No account. Source never leaves your machine.

Related MCP server: lens

⚙️ How it works

            AI CODING AGENT (Claude / Codex / Cursor / ...)
                              │  setsu_context("How does checkout reach Stripe?")
                              ▼
                    ┌──────────────────┐
                    │   SETSU ROUTER   │  task classifier
                    └────────┬─────────┘
          ┌─────────────────┼──────────────────┐
          ▼                 ▼                  ▼
   Graph traversal    Lexical / FTS5      Repo map (PageRank)
          └─────────────────┼──────────────────┘
                            ▼
                  TOKEN BUDGET PACKER
                            ▼
              ContextPack (~1,300 est. tokens)
     path: CheckoutController → CheckoutService → PaymentGateway → StripeAdapter

Below the retrieval layer: files → content hash → tree-sitter parse → symbol + edge extraction → import resolution → PageRank + Louvain communities → SQLite (FTS5 included) → incremental watcher.

⚡ Quickstart

npm install -g @setsu-ai/cli    # or npx @setsu-ai/cli init

setsu init                      # detect agents, build the graph, offer MCP install
setsu context "How does checkout reach the payment gateway?" --explain
setsu doctor                    # what your agent setup costs per session
setsu optimize --dry-run        # what SETSU would improve, as diffs

🧰 Commands

Command

What it does

setsu init

Detect agents, create .setsu/, build the graph, offer MCP + guidance install

setsu context "<q>"

Token-budgeted evidence pack; --budget, --explain, --json

setsu symbol <name>

Definition, signature, callers, callees

setsu path <a> <b>

Shortest relationship chain with edge types + provenance

setsu impact <name>

Blast radius: dependents, affected tests and files

setsu index [--watch]

Incremental reindex (or keep it fresh continuously)

setsu doctor / setsu scan --ci

Context Efficiency Score, instruction cost, thresholds for CI

setsu optimize [--dry-run|--apply]

Guidance + MCP install with backup/rollback; advisory dedupe

setsu learn / setsu feedback

Learned strategy scores; rate the last pack

setsu privacy inspect|purge

Exactly what is stored where; delete it all

setsu mcp serve

The 5-tool MCP surface over stdio

setsu benchmark

Grep-first baseline vs SETSU, estimated tokens, honest numbers

🔒 Privacy

Everything is local: the graph lives in ~/.setsu/repos/<id>/graph.db, usage learning in ~/.setsu/setsu.db. No network calls, no telemetry, no accounts. Task terms are hashed with a per-device salt before storage; raw prompts are never persisted. setsu privacy inspect lists every stored category and location; setsu privacy purge --yes deletes all of it.

🗺️ Roadmap

Version

Focus

Status

v0.1

TS/JS + Python graph, hybrid retrieval, MCP, doctor/optimizer, local learning

this release

v0.2

Java/C#/Go/Rust, deep LSP enrichment, Kiro/Copilot deep adapters, framework route + test + database graphs, retrieval bandit

planned

v0.3

Optional semantic retrieval, cross-agent config compiler, Graphify import, Serena bridge, memory provider SDK

planned

🤝 Contributing

Contribution ladder — pick your entry point:

  1. Benchmark task — add a task to benchmarks/; retrieval quality lives and dies by real questions

  2. Fixture + golden — a code pattern we extract badly makes a great failing test

  3. Language extractorpackages/parsers/src/extractors/ has the pattern to follow

  4. Adapter depth — deepen Copilot/Kiro config generation in packages/agents

  5. Core — router, packer, graph algorithms

npm install && npm test is all it takes to start. Every PR needs tests.

📄 License

Apache-2.0 © 2026 Aritra Ghosh · NOTICE · Third-party notices

Maintenance

ActivityMaintained
ResponsivenessNo issues

Resources

Unclaimed servers have limited discoverability.

Looking for Admin?

If you are the server author, to access and configure the admin panel.

Related MCP Connectors

Related MCP Servers

  • A
    license
    Not graded
    quality
    B
    maintenance
    Provides token-efficient code retrieval for coding agents by indexing repositories and enabling ranked snippet search, symbol outlines, and surgical line reads.
    MIT
  • F
    license
    Not graded
    quality
    C
    maintenance
    Provides persistent codebase memory and semantic context for AI agents via AST-aware chunking and symbol graph indexing.
    1
    -
  • A
    license
    Not graded
    quality
    A
    maintenance
    Provides AI agents with causal code memory by indexing repositories into a graph of symbols and edges, enabling context-aware retrieval of relevant code slices.
    3
    MIT