#Agent16 posts
24 min read

Build GeekAgent from Scratch — Day 16 Plugin Framework

A 7-day tutorial on building an Agent from scratch, writing the simplest possible Agent/Harness in TypeScript. Day 16 wraps capabilities into standalone plugins: drop a subdirectory with a plugin.ts into plugins/ and the main program loads it automatically at startup — commands, tools, and HTTP services all become plug-and-play.

20 min read

Build GeekAgent from Scratch — Day 15 MCP Tool Integration

A 7-day tutorial on building an Agent from scratch, writing the simplest possible Agent/Harness in TypeScript. Day 15 integrates MCP: servers are declared in a config file, JSON-RPC runs over stdio at startup, and tools provided by external processes land straight in the model's tool list.

16 min read

Build GeekAgent from Scratch — Day 13 Proactive Memory

A 7-day tutorial on building an Agent from scratch, writing the simplest possible Agent/Harness in TypeScript. Day 13 cuts long-term memory into small chunks, finds the relevant ones with BM25, and automatically places them into the context before every turn.

16 min read

Build GeekAgent from Scratch — Day 11 Skills

A 7-day tutorial on building an Agent from scratch, writing the simplest possible Agent/Harness in TypeScript. Day 11 packages task instructions and tools into skills that can be loaded and unloaded on demand, controlling which tools the model can see at any moment.

11 min read

Build GeekAgent from Scratch — Day 10 Project Instructions and Long-term Memory

A 7-day tutorial on building an Agent from scratch, writing the simplest possible Agent/Harness in TypeScript. Day 10 adds two kinds of cross-session information: AGENTS.md stores project rules, and memory stores know-how accumulated while running, so a freshly created session's model knows the project rules and remembers previously confirmed preferences.

18 min read

Build GeekAgent from Scratch — Day 9 Task Planning and Subagents

A 7-day tutorial on building an Agent from scratch, writing the simplest possible Agent/Harness in TypeScript. Day 9 makes the Agent list a plan before acting: add a TODO table maintained by the model, plus a subagent that isolates context. The main Agent arranges the order, the subagent handles small tasks with clear boundaries, and current progress always shows in the right-hand panel.

15 min read

Build GeekAgent from Scratch — Day 8 Permissions and Rollback

A 7-day tutorial on building an Agent from scratch, writing the simplest possible Agent/Harness in TypeScript. Day 8 draws boundaries for tools and leaves an escape hatch for writes: use .geekagent/GeekAgent.json to define permissions and directory boundaries, and save the most recent state before every file write—operations that shouldn't happen are blocked up front, and mistakes can be reverted with /undo.

20 min read

Build GeekAgent from Scratch — Day 7 Lightweight TUI and Usage Panel

A 7-day tutorial on building an Agent from scratch, writing the simplest possible Agent/Harness in TypeScript. Day 7 gives the terminal a new desk: the program temporarily takes over the whole screen, the message stream lives on the left, and a usage panel stays permanently on the right — per-turn / total tokens and context usage stay visible while you chat, and the original terminal content is restored on exit.

14 min read

Build GeekAgent from Scratch — Day 6 Multiple Sessions and Persistence

A 7-day tutorial on building an Agent from scratch, writing the simplest possible Agent/Harness in TypeScript. Day 6 does two things: let one process maintain several mutually independent sessions at once (/new, /sessions, /open), then persist the whole session collection together with the current ID to JSON in one shot (/save, /load, auto-save on exit) — "chat long" is upgraded to "split apart and kept around".

14 min read

Build GeekAgent from Scratch — Day 5 History Compaction

A 7-day tutorial on building an Agent from scratch, writing the simplest possible Agent/Harness in TypeScript. Day 5 tackles "chat long without forgetting": when the history array only grows and the conversation keeps getting longer, history compaction keeps the context size under control, so long conversations stay within the model's context window.

26 min read

Build GeekAgent from Scratch — Day 4 File Tools and Registry

A 7-day from-scratch tutorial for building an Agent/Harness by hand in TypeScript. Day 4 splits both reads and writes out of the shell: reads go through confirmation-free dedicated tools (ls/read/glob), writes go through a dedicated channel that shows a diff before touching disk (write/patch), and the accumulated tools are unified into a single registry — the first time the model completes the full read → modify → verify loop.

10 min read

Build GeekAgent from Scratch — Day 3 Bash Tool

A 7-day from-scratch tutorial for building an Agent/Harness by hand in TypeScript. Day 3 wires up the model's first tool that touches the real machine: running shell commands locally, with three guardrails — timeout, output truncation, and confirm-before-run — so the Agent can finally take real action.

14 min read

Build GeekAgent from Scratch — Day 2 Tool Calling Loop

A 7-day build-an-Agent-from-scratch tutorial: hand-write the simplest possible Agent/Harness in TypeScript. Day 2 builds the tool calling loop: the model can request get_current_time, the program executes it and hands the real time back to the model, laying the groundwork for the command and file tools to come.

12 min read

Build GeekAgent from Scratch — Day 1 REPL Foundation

A 7-day build-an-Agent-from-scratch tutorial: hand-write the simplest possible Agent/Harness in TypeScript/Node.js, implementing a REPL loop and streaming multi-turn conversation from zero. This post covers what a REPL is, why it makes the right foundation for an Agent, and how readline plus an OpenAI-compatible API gets the first step, "being able to chat," running in under 160 lines of code.