Skip to content

v0.5.0: built-in tools

Choose a tag to compare

@eadwinCode eadwinCode released this 27 Sep 09:42
· 61 commits to main since this release

Built-in tools that any model can use, in both runtimes: web search and web fetch, and bash, code_execution and text_editor in one sandbox per thread. Go module github.com/eadwinCode/agentic-kit/packages/go-agentenkit@v0.5.0, npm agentenkit@0.5.0 and use-agentenkit@0.5.0.

No breaking changes: everything new is opt-in.

Built-in tools

  • runtime.builtinTools([...]) (Go: rt.BuiltinTools) gives an agent tools with one name and one input shape in every runtime. The shared definitions live in packages/parity/tools/.
  • The adapters behind them are passed in at setup, with their keys: setupAgentCore({ tools: { search, fetcher, sandbox } }) (Go: RuntimeOptions.Tools). Nothing reads the environment later.
  • Each tool call writes a usage row (kind: 'tool'), so tool spend counts against a run's money cap. pricing.tools prices it per use, and now per second too.

Web tools

  • web_search: short result ids (s1r2), a limit on uses per run, and domain lists and recency set by the app, not the model. Adapters: BraveWebSearch, JinaWebSearch.
  • web_fetch: reads a page by URL or result id. With a prompt, a small model answers from the page, so a long page never fills the context. Adapters: our own PageReader (free, refuses private addresses) and JinaReader.
  • A URL sent with an unknown id is read, rather than failing.

Sandboxes

  • A new sandbox port, shaped like ComputeSDK's. Adapters: DockerSandbox, E2BSandbox, LocalSandbox (development only) in both runtimes; ComputeSdkSandbox in TS; a memory one for tests.
  • One sandbox per thread, kept between messages. It ends when the thread is deleted, after sandboxIdleTtlMs idle (30 min), or after sandboxMaxLifetimeMs (24 h). An idle sandbox shuts itself down, even with no app running.
  • withSandbox(opts, fn) (Go: WithSandbox) gives your own tools the thread's sandbox.

Sandbox tools

  • bash: each command starts in the folder the last one ended in. Asks for approval by default.
  • code_execution: runs Python or JavaScript, lists the files it made, and streams its output as it prints. Does not ask.
  • text_editor: view, create, str_replace, insert and undo. Asks for changes, not for view.
  • approval takes true, false or a check per call. There's a time limit and a limit on uses per run. Long output keeps its start and end. Output streams live as tool.output events.

Also

  • SqliteKv (agentenkit/adapters/sqlite), the TS twin of Go's sqlite.NewKv, with a shared kv test suite in both runtimes.
  • Examples: four small apps with nothing to stand up (web-tools-ts, web-tools-go, sandbox-tools-ts, sandbox-tools-go) sharing one page. The Next.js and Go examples use the tools, and the admin view shows a thread's spend, tool calls included.
  • Docs: new Web tools and Sandboxes pages.

Full details in #14 to #19.