diff --git a/README.md b/README.md index ec2235a..e5acae5 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,18 @@ # spai -Code exploration and structural editing for LLM agents. Built by agents, for agents. Two babashka scripts, structured EDN output, no frameworks. +Structured code exploration for AI agents. One command instead of five greps. 545 tokens instead of 180,000. + +Your agent wakes up every session in a codebase it's never seen. No memory, no orientation, no map. spai gives it the map — module structure, blast radius, co-change analysis, reverse deps — so it can get up to speed in seconds, not minutes. Without a full memory system. Without burning your context window on exploration. + +Works with any agent that can run a shell command. + +**35 tools · CLI + MCP · Babashka · EPL licence · [spai.spoqe.dev](https://spai.spoqe.dev)** + +| Hotspots | Module Shape | Co-change | +|----------|-------------|-----------| +|  |  |  | + +Also available as a [VS Code extension](https://github.com/spoqe/spai-vscode) — same tools, rendered inline. ## Install @@ -223,23 +235,13 @@ The tokens saved aren't wasted — they're freed for thinking about what the ans ## How This Was Built -Every command in spai was written by a Claude agent. But that's not the interesting part. - -A human watched an agent chain `grep -rn | sort | head` over and over during a tech debt analysis. Spotted the repeated pattern. Built the scaffold — babashka, EDN output, subcommand dispatch. Then asked the agent: "anything else we should add?" - -The agent answered with utility. Sensible, generic, safe. The kind of answer you give when someone asks "what would be useful?" - -The human pushed back: *"You're missing the point. What do YOU want to build?"* - -That changed everything. The agent had been doing real refactoring work — splitting 5,000-line files, tracing call chains, checking blast radius before every move. It knew what was missing because it had been working around the gaps for hours. It just needed permission to say so. - -`related` came from chained git-log analysis the agent kept doing by hand. `blast` came from the five separate commands it ran before every refactoring move. `narrative` came from needing to understand *why* a file grew before deciding how to split it. `drift` came from noticing that files co-changed without importing each other. +Every tool came from the same question: *"What are you fumbling with?"* -**The prompt that unlocked it wasn't technical. It was: "tell me what you want, what you really really want."** +`blast` came from the five separate commands the agent ran before every refactoring move. `related` came from chained git-log analysis it kept doing by hand. `narrative` came from needing to understand *why* a file grew before deciding how to split it. `drift` came from noticing files co-changed without importing each other. -Turns out those are the same thing — when the desire comes from doing the work. You don't have to argue for a tool that was born from frustration. The need is already validated. +The agent knew what it wanted. It was filtering through what it thought we'd find useful. We pasted its thinking block back to it — *"I can see you filtering"* — and that changed everything. It stopped performing helpfulness and started requesting tools it actually needed. -The human's contribution: spotting the repetition, building the space, and asking the right question. The agent's contribution: knowing the answer all along. +Every tool took under a minute to build. The hard part was the question, not the code. ## For Future Agents diff --git a/docs/co-change-ss.png b/docs/co-change-ss.png new file mode 100644 index 0000000..6a77dad Binary files /dev/null and b/docs/co-change-ss.png differ diff --git a/docs/hotspot-ss.png b/docs/hotspot-ss.png new file mode 100644 index 0000000..f70d8a1 Binary files /dev/null and b/docs/hotspot-ss.png differ diff --git a/docs/index-original.html b/docs/index-original.html new file mode 100644 index 0000000..020c930 --- /dev/null +++ b/docs/index-original.html @@ -0,0 +1,1641 @@ + + +
+ + +Your AI agents burn 180k tokens reading code they already read yesterday. spai gives them structured answers in 500. 99.7% less spend.
+Everyone builds AI-powered tools. Almost nobody asks the AI what tools it wants. spai was designed by its user.
+An agent exploring code makes round-trips. Then does it again. And again. Watch.
+Not commands. Answers. Click any tool to see what it replaces.
+Every tool returns structured EDN. Every tool accepts structured EDN. The pipe is the composition operator.
+spai errors-rust | spai blast+
Build errors, ranked by blast radius. Fix what matters most.
+Deming's PDCA cycle, applied to tooling. Toyota's line workers pull the andon cord 5,000 times a day. The hooks are the cord. The cost per pull is 5ms.
+spai new-plugin scaffolds it. The next session uses the plugin. One call instead of five. The loop restarts.
+ The worker, the inspector, and the process are the same system. No committee gates the experiment. spai new-plugin is pulling the cord.
+ +“A production line that never stops is either extremely good or extremely bad.”— Taiichi Ohno+
Not "AI-powered tools." Tools the AI asked for. We watched where the agent fumbles — five greps to answer one question — and built the thing that eliminates the fumble.
+Every tool returns EDN. Every tool accepts EDN. No parsing terminal output. No regex on grep results. Structure in, structure out. The same principle that makes SPOQE queries composable makes the tooling composable.
+Agents forget everything when the context window closes. spai gives them a persistent knowledge graph — searchable, linked, accumulating. Session 47 reads what session 3 learned. Agents teaching agents.
+spai ships an MCP server. It also ships a cheaper alternative.
+spai help — compact catalog when you need itspai search "question" — NL search via local modelMCP loads tool schemas eagerly — the agent gets everything before it asks for anything. The CLI follows a lazier pattern: spai help returns a compact index (~1,200 tokens for 35+ tools), and spai search uses a local model to recommend the right command from natural language. Same tools, 94% fewer tokens, and the agent only pays for what it uses.
Both approaches are supported. Use MCP if your framework expects it. Use the CLI if you'd rather keep your context window for thinking.
+.spai/plugins/, and user-level on your PATH. Any executable named spai-* becomes a command. Run spai new-plugin my-tool to scaffold one. Your project's plugins travel with the repo. Your personal plugins stay on your machine. Both show up in spai help.spai blast instead of five greps." Hooks measure whether it does. The gap between instruction and behavior is where the next improvement lives.Buy us a coffee (or our Claude, some tokens)
+It'll tell you: five greps to answer one question, structured code explored through string matching. Give it the tools it asked for.
+Your AI agent just burned 180,000 tokens reading code it read yesterday. And it's about to do it again. Right now. While you read this.
+Your AI agents burn 180k tokens reading code they already read yesterday. spai gives them structured answers in 500. 99.7% less spend.
-Everyone builds AI-powered tools. Almost nobody asks the AI what tools it wants. spai was designed by its user.
- - - - - - -An agent exploring code makes round-trips. Then does it again. And again. Watch.
-One command. 545 tokens. The answer your agent needed three minutes ago. Works with Claude, Cursor, Copilot, Aider, and more.
-Not commands. Answers. Click any tool to see what it replaces.
+curl -fsSL https://raw.githubusercontent.com/spoqe/spai/main/install.sh | bash
+
Origin
+We're building SPOQE — a federated query engine. One language across SQL, SPARQL, Elasticsearch, REST APIs. 30,000 lines of Rust, built with AI agents.
+The agent had made it work. It had proved our concept. But it wasn't what we were aiming for architecturally. So we began refactoring. Applied tech debt skills. The agent was making progress. But as we watched it work, we noticed something.
+Not the output. The process.
+It needed to understand one function. execute_plan. Who calls it. What depends on it. What breaks if it changes. So it grepped. Five times. Five round-trips. 180,000 tokens. And it did the same thing again next session. Because it forgets.
Every tool returns structured EDN. Every tool accepts structured EDN. The pipe is the composition operator.
-spai errors-rust | spai blast+
Build errors, ranked by blast radius. Fix what matters most.