Snapshot của geektutu/7days-python: 29★ · TypeScript · Backend. 7 days agent / harness from scratch 7天用动手写/从零实现 Agent/Harness系列
Tóm tắt dựng từ metadata GitHub của chính dự án — chưa có bài review TopGit. Trang sẽ tự động cập nhật khi bài review đầy đủ được xuất bản.
VÌ SAO CHƯA CÓ REVIEW
TopGit viết bài đầy đủ cho repo có nhiều sao nhất và được yêu cầu nhiều nhất. Trang này là snapshot trong thời gian chờ — xem README gốc ở tab READ ME.
Building an Agent from scratch (benchmarked against PI / OpenCode): one feature per day, always the simplest implementation.
Read online: Build GeekAgent from Scratch in 7 Days
Running
npm run dev -- dayN/index.ts
Daily Plan
Phase A: Foundations (Day 1–4) — Can chat, and starts to act
Day
Feature
Simplest implementation notes
1
REPL + streaming multi-turn chat
readline reads line by line, a Chat class holds history, OpenAI-compatible API streams the output
2
Tool calling loop
Model returns tool_call → execute → send result back → continue; first tool: current time. (Exception: structural changes to the Chat class are allowed to support tool_calls delta)
3
Shell execution tool
child_process runs commands, with timeout + output truncation + confirmation before execution (confirmation logic extracted as a standalone function, ready for a later permission model to replace)
4
File read/write tools + tool consolidation
ls/read/glob are read-only and need no confirmation; write/patch show a diff + confirmation before writing; the 7 accumulated tools get a unified Tool interface + registry — the Agent closes the loop on "read → modify → verify" for the first time
When history grows too long, the model summarizes old text to free up context
6
Multi-session + session persistence
/new/sessions/open in-memory multi-session; /save/load persist all sessions and the current ID to .geekagent/sessions.json, auto-save on exit
7
Lightweight TUI + usage display
A persistent right-side panel shows per-turn/cumulative tokens and context usage ratio in real time; streamed replies and tool progress lines all enter the main area with coloring. Alt screen + two-pane full-frame redraw
Phase C: Safety & Permissions (Day 8) — Dares to act, and can contain the blast radius
Day
Feature
Simplest implementation notes
8
Permission model + directory isolation + secret protection + undo
Tool-level policy (ask/allow/deny) and the allowed root directory are configured via .geekagent/GeekAgent.json; file tools only read/write inside the root, tool results automatically mask KEY-type environment variables; the latest state is backed up before writing files, /undo restores
Phase D: Capability Upgrades (Day 9–12) — More like a real Agent
Day
Feature
Simplest implementation notes
9
Task planner + sub-agent decomposition
Maintain a TODO list and execute it step by step, view with /todos; big tasks split into subtasks executed serially (simple pipeline, not parallel)
Project-root AGENTS.md fully injected into the system prompt; important runtime conclusions written to a memory file, searched by keyword and reused across sessions
11
Skills system
A skills/ directory = a set of system prompts + tool collections, /use <name> loads on demand
12
Code search + web fetch
A search tool (ripgrep style) searches the repo; fetch turns web pages into markdown, letting the model see the outside world
Phase E: Memory & Knowledge Base (Day 13–14) — Remembers well, reads well
Day
Feature
Simplest implementation notes
13
Memory upgrade (BM25 chunked retrieval + auto recall)
memory_search upgrades from "whole-entry keyword inclusion" to "windowed chunking + BM25 scoring", hitting precise paragraphs even in long entries; each turn slices the user's input into bigrams for automatic retrieval, relevant memories are injected straight into the system prompt — the model doesn't have to remember to search
14
Lightweight RAG knowledge base
rag_add batch collection (internal fetch, full text to disk, bypassing model context) → chunking → reuses Day 13's BM25 scoring → rag_search retrieves with sources by question; the /rag command builds the index offline
Phase F: Ecosystem Connectivity (Day 15–16) — Tools you don't have to write
Day
Feature
Simplest implementation notes
15
MCP tool integration
.geekagent/mcp.json declares servers; at startup spawn subprocesses and exchange line-delimited JSON-RPC over stdio: initialize handshake → tools/list → register as mcp_<server>_<tool> into the Day 4 registry; calls are forwarded as tools/call, defaulting to ask confirmation
16
Plugin framework + web chat UI
At startup scan plugins/*/plugin.ts, register commands, tools and lifecycle hooks through a PluginContext; an echo plugin demonstrates the extension points, a web plugin starts an HTTP service and reuses the existing chat & tool loop over SSE
geektutu/7days-python thuộc nhóm Backend trên TopGit, cùng 4 topic GitHub. Trang Trending và Topics liệt kê các repo cùng số sao và cùng ngôn ngữ để so sánh.
Đọc thêm về geektutu/7days-python ở đâu?
Trang TopGit này là một snapshot — tab "Readme" hiển thị nguyên văn README của repo (đã bỏ link, giữ ảnh). Repo GitHub ở github.com/geektutu/7days-python là nguồn chính thức.
geektutu/7days-python có phải mã nguồn mở không?
Có — geektutu/7days-python phát hành theo license MIT, nghĩa là mã nguồn mở để đọc, fork và (tùy license) tái sử dụng. Mã: github.com/geektutu/7days-python.
geektutu/7days-python có trang demo không?
Dự án có trang chủ ở https://geektutu.com/books/geekagent. Tab "Readme" ở trang này thường có ảnh chụp và hướng dẫn bắt đầu nhanh.
geektutu/7days-python dùng license gì?
geektutu/7days-python phát hành theo license MIT. Nên mở file LICENSE trên GitHub để xác nhận — license metadata đôi khi lệch với thực tế dự án.
geektutu/7days-python là gì?
geektutu/7days-python (geektutu/7days-python) là dự án TypeScript trên GitHub. Theo mô tả gốc: 7 days agent / harness from scratch 7天用动手写/从零实现 Agent/Harness系列
Vì sao geektutu/7days-python được xếp vào nhóm Backend?
TopGit xếp geektutu/7days-python vào nhóm Backend dựa trên GitHub topics và mô tả của repo (gắn thẻ: "agent", "harness", "learning"). Việc phân loại dựa trên metadata thật của repo, không phải đoán theo cảm tính biên tập.
Đọc đầy đủ README ở tab phía trên.
Muốn nghe thêm một ý kiến về 7days-python?
Hỏi một AI đọc được trang này — một cú bấm là có ngay nhận định về 7days-python.