百科.dev
全部条目在线工具AI 编程趋势榜开源项目技术资讯提交条目
登录
< 返回工具列表
A

agentty

> AI 编程
开源

在终端中进行 AI 双人编程 — 一个静态二进制文件,启动时间小于毫秒,可使用任何模型

395 stars0 点赞1 次浏览
访问官网GitHub

工具介绍

在终端中进行 AI 双人编程 — 一个静态二进制文件,启动时间小于毫秒,可使用任何模型

agentty

A blazing-fast, open-source coding agent in your terminal.

A drop-in Claude Code alternative in C++26 — one static binary, millisecond startup, any model.

Why agentty?

Most terminal coding agents ship as a Node or Python app and send big chunks of your repository to the model on every turn. agentty takes the opposite approach:

  • It's one native binary. 16.7 MB, ~3 ms cold start, zero runtime dependencies — no Node, no Python, no npm install, no node_modules. Download and run.
  • It sends only the relevant code. Built-in retrieval (hybrid BM25 + dense embeddings, code-aware chunking, GraphRAG) fetches just the slices that matter — often cutting context by 80%+ vs. whole-repo dumping.
  • It's not locked to one vendor. Sign in with your Claude Pro/Max, or point it at OpenAI, Groq, OpenRouter, Cerebras, DeepSeek, xAI (Grok), Mistral, Gemini, Fireworks, or a fully local Ollama model. Switch live with ^P.
  • It's safe by default. Shell and build commands run in a sandbox; air-gap an entire session over SSH with one command.
  • It's open source (MIT) and runs inside Zed over ACP.

Coming from another tool? See the honest comparisons: vs Claude Code · vs Aider · vs Cursor · all alternatives.

Getting Started

bash
curl -fsSL https://raw.githubusercontent.com/1ay1/agentty/master/install.sh | sh
cd your-project
agentty

First launch opens auth — paste an API key (Anthropic sk-ant-…, or any provider's key) or use a local Ollama model that needs no key at all. You can also sign in with your Claude Pro/Max OAuth if you prefer. Once you're in, a first-run welcome card suggests a few things to try; just type and hit Enter.

Features

⚡ Instant, all the way through

Cold start under 1 ms; keystroke-to-pixel about 1 ms. No Node, no Python, no npm install — just a static binary. Independent tool calls run in parallel and read-only tools start while the model is still typing, so tool-heavy turns finish sooner.

Any model

Claude, GPT, Groq, OpenRouter, Ollama, or any OpenAI-compatible endpoint. Switch live with ^P.

️ Sandboxed by default

Every shell call runs inside bwrap (Linux) / sandbox-exec (macOS). File tools refuse paths outside your workspace.

Air-gapped mode

Run on a box with no internet. Your laptop relays the bytes over SSH with TLS pinned end-to-end.

Full tool suite

read · write · edit · bash · grep · glob · git · web · search_docs · search_code · task — each with a purpose-built widget.

Learns your codebase

Agent Skills + remember/forget memory, plus a fully local RAG engine — hybrid BM25 + embeddings, RRF-fused, reranked, diversified, and expanded over a GraphRAG document graph — over your docs, skills, and memory. Teach it once, every session knows your conventions. How it works ↓

Smart Mode

One flagship model plans; cheaper models do the legwork. Effort scales to each turn's complexity, a cascade retries harder only when a cheap attempt falls short, and the router learns your repo across sessions. Off is a strict no-op. How it works ↓

Providers

…

--provider persists. Switch live in-app with ^P.

Retrieval (RAG)

Retrieval without context dumping

Rather than injecting a repository or every project document into each prompt, agentty retrieves a small, source-tagged set of relevant passages only when the task needs project knowledge. That keeps context focused, leaves more room for the task itself, and avoids paying to repeatedly send irrelevant material.

agentty ships a complete, fully-local retrieval engine behind two tools — no cloud, no dependencies, works offline. The only optional network hop is a localhost Ollama server for embeddings; with none reachable it falls back to keyword search and keeps working.

  • search_docs — searches your knowledge base: a docs folder, your installed skills, your learned remember memory, and (opt-in) connected MCP resources. Useful from the first turn — skills and memory are always indexed, even with no docs folder.
  • search_code — semantic search over your source by meaning, for "where is retry backoff handled" questions where you don't know the identifier. The hybrid complement to grep.

Every returned passage is source-tagged (docs: · skill: · memory: · MCP URI) with its file + line range, so the model can cite, open, or follow it.

Enable the semantic half (BM25 works with zero setup):

bash
ollama pull nomic-embed-text && ollama serve     # localhost embeddings
export AGENTTY_DOCS_DIR=~/my-project/docs         # optional; skills+memory always indexed

agentty auto-detects the running server and upgrades from BM25-only to full hybrid retrieval — no restart needed.

The retrieval funnel

Every search_docs call runs this pipeline. The default path makes no LLM calls — it's fast, deterministic, and safe to leave fully on.

  1. Hybrid retrieval — BM25 (keyword, Porter-stemmed) and dense embeddings (HNSW-indexed at scale) each rank a wide candidate pool; the two lists are fused with Reciprocal Rank Fusion (or opt-in Relative Score Fusion, AGENTTY_RAG_FUSION=rsf). Every dense probe a search fans out — expansion, HyDE, multi-hop — embeds in one batched round-trip, not one per probe.
  2. Pseudo-relevance feedback (RM3) — harvests discriminative terms from the top hits and fuses a second down-weighted probe, recovering the vocabulary you didn't type. Sub-millisecond, no model.
  3. Contextual retrieval — each chunk is indexed with a breadcrumb of its doc title + heading path, so guide.md › Install › Linux is findable even when the body never says "linux".
  4. Re-ranking — a deterministic feature-fusion reranker (term coverage, phrase proximity, title match, calibrated cosine), plus an optional batched embedding cross-encoder and an opt-in generative 0–10 judge.
  5. MMR diversification — greedily keeps hits that are relevant and distinct, so duplicate windows don't crowd out real answers.
  6. Compression — trims each survivor to its best query-relevant span: "20k noisy tokens" → "2k useful tokens."
  7. Parent-document expansion — stitches the precise hit back into its adjacent sibling chunks so the model reads it in context.
  8. GraphRAG expansion — builds the corpus's document graph (nodes = docs; edges = markdown links + tf·idf entity co-occurrence), runs PageRank and community detection over it, and pulls in supporting docs from four tiers around the top hits (outbound links, backlinks, entity neighbours, and the community hub). Deterministic, in-memory, no model.
  9. Corrective retry (CRAG) — on a low-confidence result, de-noises the query, widens the pool, and keeps whichever attempt scored higher.

Opt-in recall boosters (cost a model call, off by default): RAG-Fusion query expansion (AGENTTY_RAG_EXPAND=1), HyDE hypothetical-document embeddings (AGENTTY_RAG_HYDE=1), and GraphRAG community summaries (AGENTTY_RAG_GRAPH_SUMMARY=1 — a cached natural-language report per topic cluster, generated once per corpus shape).

Beyond the explicit tool, a proactive path runs the funnel before you ask when your message looks knowledge-shaped, injecting a source-tagged `` block into the very same turn — grounding without a tool round-trip. The transcript renders it as one quiet card that shows a confidence bar plus exactly which sources grounded the answer (docs · path, skill · name, memory…) and a passage count, so you can always see — and weigh — what the model was standing on.

BM25, RRF, HNSW, the reranker, MMR, compression, PRF, the chunker, and the GraphRAG document graph (PageRank, entity extraction, community detection) are all in-house C++/STL. Every stage degrades gracefully and is tunable via AGENTTY_RAG_* env vars. For big corpora, two opt-in vector-cost levers keep the ANN cheap while the full-precision rerank recovers quality: Matryoshka dimension truncation (AGENTTY_RAG_ANN_DIM=256, ~2.3× faster walk) and binary quantization (AGENTTY_RAG_BINARY=1, popcount-Hamming walk + float rescore, ~2.5×). Full write-up: docs/website/retrieval.md.

Smart Mode

One model rarely fits every turn. A one-line rename and a cross-file refactor don't deserve the same effort, and burning flagship reasoning on trivia is just slow and expensive. Smart Mode (^S) fixes that with an orchestrator-workers design: a strong model owns the plan and delegates well-scoped subtasks to cheaper workers.

It's built from three roles and eight independent layers, each a toggle:

  • Strategic (flagship) plans and delegates · Implementation (mid) writes code · Utility (cheap) handles summaries and grunt work. The resolver maps a role to (model, effort) — it never checks a model name by string, so pinning any model to any slot is always safe.
  • Complexity-scaled effort sizes each turn (trivial → complex), and a cascade retries at higher effort only when a cheap attempt actually falls short — the RouteLLM/cascade idea applied inside the agent loop.
  • Because the loop sees outcomes a stateless router can't — the build fails, the test goes red, you correct the next turn — Smart Mode learns per-workspace: it persists the effort prior the cascade discovered and recalls decompositions that worked. The second session in a repo is smarter than the first. All learning is local, on-disk (.agentty/), and wipeable.

Open the overlay with ^S; the footer shows what it's learned in this repo. Off is a strict byte-for-byte no-op — zero extra tokens, zero latency. Full write-up: docs/website/smart-mode.md.

Keys

Key Action Key Action
Enter Send / queue ^K Command palette
Esc Cancel / reject ^J Thread list
S-Tab Cycle profile ^P Provider picker
Alt+Enter Newline ^/ Model picker
^B Loop: resend until off ^N New thread
^G Run code block ^S Smart Mode
^R Review changes ^T Plan / todo
^O Inspect tool outputs ^E Expand composer
^C Quit (from anywhere)
^←/→ or Alt+←/→ Cycle threads

The composer is a full readline-style editor:

Key Action Key Action
^←/→ Move by word ^W / Alt+D Delete word back / forward
^U / Alt+K Kill to line start / end ^Z / ^Y Undo / redo
^V / Alt+V Paste image / @ # Command / file / symbol picker
↑ Recall queue / history Alt+↑/↓ Edit queued messages one at a time

Full keymap: docs/website/keybindings.md. Pasting images over SSH needs one terminal setting — see Clipboard & Images.

More

Installation options

Linux

…

macOS

bash
brew tap 1ay1/tap && brew install agentty

Windows

powershell
scoop bucket add 1ay1 https://github.com/1ay1/scoop-bucket; scoop install agentty
# or
winget install agentty.agentty

Termux / Android (no root, no proot)

agentty builds natively against Termux's Bionic/libc++ toolchain. The install script detects Termux and installs into $PREFIX/bin (on your PATH):

bash
pkg install git cmake clang openssl libnghttp2
curl -fsSL https://raw.githubusercontent.com/1ay1/agentty/master/install.sh | sh -s -- --build

Shell/build tools run unsandboxed on unrooted Android (Bubblewrap needs user namespaces Android doesn't grant)

Issues· 1 开放

查看全部 Issues在 GitHub 打开

暂无开放 Issues,或尚未同步最近议题。

> 标签

C++acpagentic-codingai-agentairgap

暂无评论,来聊聊你的看法吧

> 工具信息

发布日期2026年8月1日
最后更新2026年9月17日
分类AI 编程
定价开源

> 相关工具

G
GitHub Copilot
GitHub 官方 AI 编程助手,覆盖补全、Chat 与 Agent 模式。
C
Cursor
AI 原生代码编辑器,对话改代码、多文件 Agent 与规则体系是其核心。
S
skills
Skills for Real Engineers. Straight from my .agents directory.