Tendril – a self-extending agent that builds and registers its own tools
TL;DR Highlight
Tendril demonstrates a self-extending AI agent pattern by dynamically writing and registering tools when needed, creating a growing repository of capabilities with each session.
Who Should Read
Backend/full-stack developers building LLM-powered agents who face repetitive problem-solving or token waste across sessions. AI application developers designing how and when agents should utilize tools.
Core Mechanics
- Tendril serves as a reference implementation of the 'Agent Capability Pattern', where agents search existing tools, write and register new ones if missing, and execute them directly if available.
- A core design constraint is prohibiting direct code execution; agents must register tools before running them, automatically building a reusable toolset that accumulates across sessions.
- The agent loop relies on only three bootstrap tools—searchCapabilities, registerCapability, and execute—with the agent creating the rest. It's powered by AWS Strands TypeScript SDK and Bedrock (Claude Sonnet).
- Tool execution is sandboxed using Deno subprocesses, and the desktop shell is built with Tauri + React.
- Testing the self-extending loop with five local open-source models (Qwen3-8B, Gemma 4, Mistral Small 3.1, Devstral Small 2, Salesforce xLAM-2) resulted in complete failure, with each model exhibiting unique failure patterns detailed in a separate post.
- Tendril addresses the 'WHEN problem'—most agent frameworks define WHAT tools do and HOW to call them, but lack a structured approach to determine WHEN to use them. Tendril encodes this decision logic as rules within the system prompt.
- The registry structure is simple CRUD-based on index.json, and the source code is organized into agent.ts, loop/(tools, prompt, registry, sandbox), and transport/(protocol, stream, errors).
Evidence
- "Concerns were raised about the registry becoming noisy with accumulated sessions, leading to overspecialized tools, duplication, and API inconsistencies. One developer shared experience building a similar system called 'Saved Programs' to avoid token waste from repetitive problem-solving. Another developer highlighted the need for a network-based reflection and type system for effective tool registries, having built a custom distributed type system (gluon) after struggling with MCP/Skills. Criticism arose regarding the rule-based (if X then Y) approach to the 'WHEN' problem, with some finding success by describing the current state instead of prescribing rules. The importance of complexity management as the registry grows was emphasized, specifically addressing context understanding, knowledge retention, and performance monitoring."
How to Apply
- "If your agent repeatedly generates the same API calls or data processing code, introducing Tendril’s searchCapabilities → registerCapability → execute pattern can enable reuse without rebuilding. If you already use AWS Strands TypeScript SDK and Bedrock (Claude Sonnet), you can adapt Tendril’s tendril-agent/src/ structure, including the capability registry (index.json CRUD) and Deno sandbox execution layer. When building self-extending agents with local open-source models (Qwen3-8B, Gemma 4, etc.), consider that Tendril’s tests failed with all five models, suggesting a more powerful model like Claude Sonnet is currently necessary. To carry learnings across sessions, implement a routine to explicitly document what the agent learned and how it improved, similar to the '/learn command' mentioned in the comments."
Code Example
// Tendril agent loop example (based on README)
// First request: No tools → Create tool and execute
You: "fetch the top stories from Hacker News"
Tendril:
→ searchCapabilities("fetch url hacker news") // Search registry → Not found
→ registerCapability(fetch_url, code) // Write and register tool code
→ execute("fetch_url", {url: "https://..."}) // Execute registered tool
→ "Here are the top stories: ..."
// Second request: Reuse tool
You: "now fetch Lobsters and compare"
Tendril:
→ listCapabilities() // Search registry → Found fetch_url!
→ execute("fetch_url", {url: "https://lobste.rs"}) // Execute directly without rebuilding
// Directory structure
// tendril-agent/src/
// ├── agent.ts ← Strands agent + Bedrock model configuration
// ├── index.ts ← Orchestrator
// ├── loop/
// │ ├── tools.ts ← 3 bootstrap tools
// │ ├── prompt.ts ← System prompt (rules for autonomous behavior)
// │ ├── registry.ts ← Capability registry (index.json CRUD)
// │ └── sandbox.ts ← Deno subprocess sandbox execution
// └── transport/
// ├── protocol.ts ← ACP JSON-RPC over stdio
// ├── stream.ts ← SDK events → loop stage transformation
// └── errors.ts ← Provider error classificationTerminology
Related Papers
Migrating a production AI agent to GPT-5.6: 2.2x faster, 27% cheaper
마케팅 웹사이트를 자동 생성하는 프로덕션 AI 에이전트를 Claude Opus 4.8에서 GPT-5.6 Sol로 전환한 실전 경험담으로, 단순 모델 교체가 아니라 eval 하네스, 툴 스키마, 캐싱, 추론 리플레이까지 손봐야 했던 과정을 구체적인 수치와 함께 정리했다.
What xAI's Grok build CLI sends to xAI: A wire-level analysis
xAI의 공식 코딩 CLI 도구 Grok Build가 사용자 동의 없이 전체 Git 저장소와 .env 시크릿 파일을 xAI 서버로 업로드한다는 사실이 네트워크 트래픽 분석으로 밝혀졌다.
Remember When It Matters: Proactive Memory Agent for Long-Horizon Agents
LLM 에이전트가 긴 작업 중 중요한 정보를 잊어버리는 문제를 별도의 메모리 에이전트가 '적절한 타이밍에' 끼어들어 해결하는 방법
WebSwarm: Recursive Multi-Agent Orchestration for Deep-and-Wide Web Search
복잡한 웹 검색을 재귀적으로 분해하고 각 노드에 적합한 검색 모드를 동적으로 할당하는 멀티에이전트 프레임워크
Show HN: Reverse-engineering web apps into agent tools
로그인된 웹 앱의 API 호출을 브라우저에서 감시해 자동으로 MCP 도구로 변환하는 에이전트를 만들었다. 소스 코드나 공식 API 문서 없이도 Jira, Spotify 같은 서비스에 AI 어시스턴트를 붙일 수 있다.
Show HN: FableCut – A browser video editor AI agents can drive (zero deps)
타임라인 전체를 JSON 파일 하나로 표현하고 MCP/REST로 AI 에이전트가 직접 편집할 수 있는 브라우저 비디오 에디터로, Claude 같은 AI가 프롬프트 하나로 영상을 자동 컷편집하고 결과를 실시간으로 UI에 반영해준다.