agentscript  by AgentScript-AI

AI agent SDK leveraging code generation for execution plans

Created 1 year ago
253 stars

Top 99.4% on SourcePulse

GitHubView on GitHub
Project Summary

Summary

AgentScript-AI/agentscript provides an SDK for building AI agents that leverage an Abstract Syntax Tree (AST)-based code execution engine. It addresses the limitations of traditional Re-act agents by enabling LLMs to generate executable code (a subset of JavaScript) representing their plans, rather than just tool calls. This approach allows for more abstract reasoning, stop/start workflows, robust state management, and enhanced observability, benefiting developers building complex AI agents.

How It Works

The core innovation lies in prompting an LLM to generate AgentScript, a restricted JavaScript dialect, which is then parsed into an AST. This AST is executed within a safe, dedicated runtime, distinct from direct Node.js execution. This AST-centric approach enables pausing, serializing, and resuming agent execution, facilitating human-in-the-loop interactions and robust state persistence. Tools can be deterministic functions or LLM-powered, integrating seamlessly with the generated code.

Quick Start & Requirements

  • Installation: npm install agentscript-ai
  • Prerequisites: Requires configuration of a language model (e.g., Anthropic Claude 3.5 Sonnet) and potentially API keys for integrated services (e.g., process.env.LINEAR_API_KEY). Specific tools may have additional dependencies.
  • Resources: Links to a demo video and examples repository are mentioned but not provided.

Highlighted Details

  • AST-based Execution: Replaces sequential LLM calls with code generation and AST interpretation for planning.
  • Resumability & State: Execution can be paused, serialized, and resumed, enabling complex workflows and human approval steps.
  • Abstract Reasoning: Agents can express plans using code constructs (implicitly, as roadmap indicates future support for explicit JS features), allowing for more sophisticated logic than simple tool chaining.
  • Observability: Built-in support for tracking execution state and flow.

Maintenance & Community

AgentScript is an open-source project actively seeking contributions. Community engagement is encouraged via a Discord server and GitHub Issues for discussions on ideas and roadmap items. The current roadmap includes expanding JavaScript feature support (e.g., if statements, arrow functions), input variables, and enhancing observability/debugging tools.

Licensing & Compatibility

The specific open-source license is not detailed in the provided README content. Users should verify licensing terms before commercial adoption.

Limitations & Caveats

AgentScript operates on a restricted subset of JavaScript, disallowing features like regexes and complex computations. The runtime supports common JS statements, but advanced features like if statements and template literals are listed as future roadmap items, indicating the current scope may be limited for complex conditional logic. The project appears to be in active development, with core functionality established but ongoing feature expansion.

Health Check
Last Commit

3 months ago

Responsiveness

1 day

Pull Requests (30d)
0
Issues (30d)
0
Star History
4 stars in the last 30 days

Explore Similar Projects

Starred by Dax Dax(Core Contributor to opencode, SST) and Adam Elmore Adam Elmore(Cofounder of StatMuse; Contributor to opencode).

oh-my-opencode by code-yeongyu

95.9%
13k
LLM agent orchestration for enhanced IDE workflows
Created 1 month ago
Updated 16 hours ago
Starred by Elvis Saravia Elvis Saravia(Founder of DAIR.AI), Chip Huyen Chip Huyen(Author of "AI Engineering", "Designing Machine Learning Systems"), and
5 more.

activepieces by activepieces

0.5%
20k
Open-source Zapier alternative for AI workflow automation
Created 3 years ago
Updated 14 hours ago
Feedback? Help us improve.