{"id":25777156,"url":"https://github.com/agentlang-ai/agentlang","last_synced_at":"2026-04-08T06:02:39.898Z","repository":{"id":323994599,"uuid":"975895250","full_name":"agentlang-ai/agentlang","owner":"agentlang-ai","description":"Build Reliable AI Agents and Agentic Apps","archived":false,"fork":false,"pushed_at":"2026-03-06T11:50:28.000Z","size":5122,"stargazers_count":53,"open_issues_count":43,"forks_count":1,"subscribers_count":1,"default_branch":"main","last_synced_at":"2026-03-06T15:47:31.044Z","etag":null,"topics":["agentic-framework","agents","ai","programming-languages"],"latest_commit_sha":null,"homepage":"https://fractl.io/agentlang","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/agentlang-ai.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":"AGENTS.md","dco":null,"cla":null}},"created_at":"2025-05-01T05:21:14.000Z","updated_at":"2026-02-26T10:21:13.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/agentlang-ai/agentlang","commit_stats":null,"previous_names":["agentlang-ai/agentlang"],"tags_count":40,"template":false,"template_full_name":null,"purl":"pkg:github/agentlang-ai/agentlang","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/agentlang-ai%2Fagentlang","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/agentlang-ai%2Fagentlang/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/agentlang-ai%2Fagentlang/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/agentlang-ai%2Fagentlang/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/agentlang-ai","download_url":"https://codeload.github.com/agentlang-ai/agentlang/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/agentlang-ai%2Fagentlang/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":30286231,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-09T02:57:19.223Z","status":"ssl_error","status_checked_at":"2026-03-09T02:56:26.373Z","response_time":61,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["agentic-framework","agents","ai","programming-languages"],"created_at":"2025-02-27T06:01:37.638Z","updated_at":"2026-03-17T07:10:46.168Z","avatar_url":"https://github.com/agentlang-ai.png","language":"JavaScript","readme":"\n\u003cdiv align=\"center\"\u003e\n\n\u003cp\u003e\n  \u003ca href=\"https://zdoc.app/ja/agentlang-ai/agentlang\"\u003e日本語\u003c/a\u003e |\n  \u003ca href=\"https://zdoc.app/es/agentlang-ai/agentlang\"\u003eEspañol\u003c/a\u003e |\n  \u003ca href=\"https://zdoc.app/fr/agentlang-ai/agentlang\"\u003efrançais\u003c/a\u003e |\n  \u003ca href=\"https://zdoc.app/de/agentlang-ai/agentlang\"\u003eDeutsch\u003c/a\u003e |\n  \u003ca href=\"https://zdoc.app/pt/agentlang-ai/agentlang\"\u003ePortuguês\u003c/a\u003e |\n  \u003ca href=\"https://zdoc.app/ru/agentlang-ai/agentlang\"\u003eРусский\u003c/a\u003e |\n  \u003ca href=\"https://zdoc.app/ko/agentlang-ai/agentlang\"\u003e한국어\u003c/a\u003e |\n  \u003ca href=\"https://zdoc.app/zh/agentlang-ai/agentlang\"\u003e中文\u003c/a\u003e\n\u003c/p\u003e\n\n\u003cdiv id=\"toc\"\u003e \u003c!-- both work, toc or user-content-toc --\u003e\n  \u003cul style=\"list-style: none;\"\u003e\n    \u003csummary\u003e\n      \u003ch1\u003eAgentlang - Reliable Enterprise AI Agents\u003c/h1\u003e\n    \u003c/summary\u003e\n  \u003c/ul\u003e\n\u003c/div\u003e\n\n\u003ca href=\"https://agentlang-ai.fractl.io\"\u003e\u003cimg src=\"https://img.shields.io/badge/Project-Home-blue?logo=homepage\u0026logoColor=blue\u0026style=for-the-badge\"\u003e\u003c/a\u003e\n\u003ca href=\"https://discord.gg/mf6ezgcg\"\u003e\u003cimg src=\"https://img.shields.io/badge/Discord-Join%20Us-purple?logo=discord\u0026logoColor=red\u0026style=for-the-badge\"\u003e\u003c/a\u003e\n\u003ca href=\"https://github.com/agentlang-ai/agentlang/tree/main/example\"\u003e\u003cimg src=\"https://img.shields.io/badge/Examples-Page-yellow?logo=homepage\u0026logoColor=yellow\u0026style=for-the-badge\"\u003e\u003c/a\u003e\n\n[![Node Version](https://img.shields.io/badge/node-%3E%3D20.0.0-brightgreen?logo=node.js)](https://nodejs.org) [![CI](https://github.com/agentlang-ai/agentlang/actions/workflows/ci.yml/badge.svg)](https://github.com/agentlang-ai/agentlang/actions/workflows/ci.yml)![License](https://img.shields.io/badge/License-Sustainable%20Use%20v1.0-blue.svg) [![npm downloads](https://img.shields.io/npm/dm/agentlang.svg)](https://www.npmjs.com/package/agentlang)\n\u003chr\u003e\n\n## Agentlang - Team as Code\n\u003c/div\u003e\n\nAgentlang is a declarative DSL (built on TypeScript) for creating AI Agents and full-stack Agentic Apps. With Agentlang, you define, version, run, mentor, and monitor teams of AI agents, along with the app infrastructure they need: data model, workflows, RBAC, integrations, and UI. We refer to this approach - bringing together AI agent development and App development into a single coherent discipline - as Team-as-Code (our riff on IaC).\n\n* **For Devs and Non-Devs:** Code and vibe-code in your IDE, focusing on the business-logic of your app, not wiring. Alternatively, you can build, run, mentor and monitor your AI Team in Studio - our visual-builder (coming soon). Switch back-and-forth between the two modes seamlessly.\n\n* **Robust Integrations:** The Agentlang runtime ships with native integrations for LLMs, databases, vector DBs, and auth providers. Our connector architecture is built for the enterprise, with a rapidly growing catalog for systems like Salesforce, ServiceNow, HubSpot, Snowflake, and more. Also, because Agentlang compiles to Node.js (and runs in the browser), you can use any existing JavaScript library out of the box.\n\n* **Production-grade**: Under the hood, it’s all modern TypeScript—strong typing, tooling, testing, and CI/CD-friendly workflows—built for enterprise-class reliability, governance, and scale.\n\nAgentlang introduces two foundational innovations: [Agentic Reliability Modeling](#-agentic-reliability-modeling) and [AgentLang Ontology](#agentlang-ontology)\n\n\u003ctable\u003e\n    \u003ctr\u003e\n        \u003ctd valign=\"top\"\u003e\n          \u003cdiv\u003e\n          \u003cb\u003eAgentic Reliability Modeling\u003c/b\u003e\n          \u003cul\u003e\n\u003cli\u003e First-class AI Agents \u003c/li\u003e\n\u003cli\u003e Flows \u003c/li\u003e\n\u003cli\u003e Decisions \u003c/li\u003e\n\u003cli\u003e Directives \u003c/li\u003e\n\u003cli\u003e Scenarios \u003c/li\u003e\n\u003cli\u003e Glossary \u003c/li\u003e\n          \u003c/ul\u003e\n            \u003cimg width=\"441\" height=\"1\"\u003e\n          \u003c/div\u003e\n        \u003c/td\u003e\n        \u003ctd\u003e\n          \u003cdiv align=\"center\"\u003e\n          \u003cimg width=\"350\" height=\"420\" alt=\"image\" src=\"https://github.com/user-attachments/assets/b240a235-3804-4423-a639-cdfb90f07282\" /\u003e\n          \u003cimg width=\"441\" height=\"1\"\u003e\n          \u003c/div\u003e\n        \u003c/td\u003e\n        \u003ctd valign=\"top\"\u003e\n        \u003cdiv\u003e\n          \u003cb\u003eAgentlang Ontology\u003c/b\u003e\n          \u003cul\u003e\n\u003cli\u003e Data Model \u003c/li\u003e\n\u003cli\u003e Auto-gen CRUD \u003c/li\u003e\n\u003cli\u003e Events \u0026 Workflows \u003c/li\u003e\n\u003cli\u003e Declarative RBAC \u003c/li\u003e\n\u003cli\u003e Auto-gen UI \u003c/li\u003e\n          \u003c/ul\u003e\n            \u003cimg width=\"441\" height=\"1\"\u003e\n          \u003c/div\u003e\n        \u003c/td\u003e\n    \u003c/tr\u003e\n\u003c/table\u003e\n\n\u003cdiv align=\"center\"\u003e\n\n## 🎯 Agentic Reliability Modeling\n\n\u003c/div\u003e\n\n### Build AI Agents that actually work!\n\nBuild **teams of reliable AI Agents** that follow your organization's processes closely, while adapting to new scenarios. Agents collaborate with each other and humans to handle complex, time-consuming, monotonous tasks and get work done!\n\nDepending solely only on instructions for agents is a recipe for failure. Natural language is beautiful, but ambiguous - forcing us to be stuck in an endless cycle of prompt-tweaking to achieve our goal. Agentlang offers **just enough structure**, to augment natural language instructions, to model various aspects of your agents - unambiguously, but still effortlessly - to make them reliable.\n\n### An Example\n\n```typescript\nflow TicketFlow {\n    ticketTriager --\u003e \"DNS\" ticketInProgress\n    ticketTriager --\u003e \"WLAN\" ticketInProgress\n    ticketTriager --\u003e \"NotEnoughInfo\" ticketPending\n}\n\nagent TicketFlow {\n    llm \"gpt4o\",\n    role \"ticket_manager\",\n    goal \"You are a network ticket management application. Your job is to triage any ticket passed to you\n          and update the ticket with appropriate assigned_to, status and triaging comments.\",\n\tglossary [\n\t\t{\"name\": \"incident\", \"meaning\": \"a problem report\", \"synonyms\": \"ticket\"},\n\t\t{\"name\": \"task\", \"meaning\": \"a record that captures some work that needs to be done\", \"synonyms\": \"ticket\"},\n\t\t{\"name\": \"DNS\", \"meaning\": \"Domain Name Service - is used to translate human-readable domain names to IP addresses\", \"synonyms\": \"DNS name, CNAME, DNS HOST record\"}\n\t\t{\"name\": \"WLAN\", \"meaning\": \"Wireless LAN - wireless network to connect devices to each other and the internet\", \"synonyms\": \"Office network\"}\n    ]\n}\n\ndecision ticketTriager {\n   case (\"Ticket is related to DNS provisioning. If the request is to point one host/DNS name to an IP address\") {\n      DNS\n   }\n   case (\"Ticket is related to WLAN provisioning. If the request is to add/whitelist a MAC address on the wireless network\") {\n      WLAN\n   }\n   case (\"There is not enough information in the ticket about what the category is\") {\n      NotEnoughInfo\n   }\n   default {\n      Other\n   }\n}\n\nworkflow ticketInProgress {\n    // workflow body is declarative code that is executed by the symbolic runtime\n    ...\n}\n```\n\n\n### ✨ First-class AI Agents\n\nAgents and many concepts agents use are built-in language constructs.\n\n```typescript\nagent TicketFlow {\n    llm \"gpt4o\",\n    role \"ticket_manager\",\n    goal \"You are a network ticket management agent. Your job is to triage any ticket passed to you and\n          update the ticket with appropriate assigned_to, status and triaging comments.\"\n}\n\ndirective TicketFlow {\n    if (\"the context indicates the ticket as handled\") {\n        \"set status to done\"\n    }\n}\n```\n\n### Flows\n\nFlows are central to Agentlang's reliability modeling. Define your business processes using an intuitive flow syntax - flows guide (not enforce) an agent's behavior closely. Agentlang's adaptive runtime will execute them, dynamically adapting the execution flow as needed.\n\nEach step in the flow can be an agent or a tool (workflow).\n\n```typescript\nflow networkProvisioningRequestManager {\n    classifyProvisioningRequest --\u003e \"DNS\" provisionDNS\n    classifyProvisioningRequest --\u003e \"WLAN\" provisionWLAN\n    classifyProvisioningRequest --\u003e \"Other\" reportFailure\n    provisionDNS --\u003e ticketUpdater\n    provisionWLAN --\u003e ticketUpdater\n}\n```\n\n### Decisions\n\nAn agent that takes a decision for branching in a flow can be expressed as a **decision table** of `case` expressions. Each `case` specifies a condition as pure text or a logical expression. The consequence of a `case` will be a tag that tells the flow-evaluator which node to branch to.\n\n```typescript\ndecision classifyOrder {\n    case (\"if requested car type is SUV and customer tier is premier\") {\n      LuxurySUV\n    }\n\n    case (\"if the requested car type is SUV and segment is economy\") {\n      EconomySUV\n    }\n}\n\nflow carOrderRequestManager {\n   analyseCarOrderRequest --\u003e classifyOrder\n   classifyOrder --\u003e \"EconomySUV\" orderEconomySUV\n   classifyOrder --\u003e \"LuxurySUV\" orderLuxurySUV\n}\n```\n\nThe `case` conditions may also be written as logical expressions:\n\n```typescript\n   case (carType == \"SUV\" and segment == \"luxury\") {\n      LuxurySUV\n   }\n\n   case (carType == \"SUV\") {\n      EconomySUV\n   }\n\n```\n\nAs the flow executes an agent that specializes in evaluating decision tables will be invoked for the node `classifyOrder`. The tag returned by this agent will be used to select either the `orderEconomySUV` or `orderLuxurySUV` node of the flow.\n\n### Directives\n\n**Directives** enhance the decision making capability of agents by providing precise actions to be taken under specific conditions.\n\n```typescript\nagent salaryHikeAgent {\n    role \"hr_manager\",\n    instruction \"Give an employee a salary-hike based on his/her sales performance\",\n    tools acme/employee\n}\n\ndirective salaryHikeAgent.hike5p { if (\"employee sales exceeded 5000\") { \"Give a salary hike of 5 percent\" }}\ndirective salaryHikeAgent.hike2p { if (\"sales is more than 2000 but less than 5000\") { \"hike salary by 2 percent\" }}\n```\n\nAs the `salaryHikeAgent` tries to compute the salary-increment for a particular employee, the directives will guide it to take a more accurate decision based on specific conditions.\n\n### Scenarios\n\n**Scenarios** provide agents with concrete examples of user-requests and their corresponding LLM-responses.\n\n```typescript\nagent salaryHikeAgent {\n    role \"hr_manager\",\n    instruction \"Give an employee a salary-hike based on his/her sales performance\",\n    tools acme/employee\n}\n\ndirective salaryHikeAgent.hike5p { if (\"employee sales exceeded 5000\") { \"Give a salary hike of 5 percent\" }}\ndirective salaryHikeAgent.hike2p { if (\"sales is more than 2000 but less than 5000\") {  \"hike salary by 2 percent\" }}\n\nscenario salaryHikeAgent.outperform {\n    if (\"Jake's sale exceeded 5000\") {\n        handleOutperform\n    }\n}\n\nworkflow handleOutperform {\n  {acme/employee {email? \"jake@acme.com\"}} @as [employee];\n  {acme/employee {id? employee.id,\n                  salary employee.salary + employee.salary * 0.5}}\n}\n```\n\nHere, the provided scenario helps the agent to take a well-specified action in the case an employee is said to have \"outperformed\".\n\n### Glossary\n\n**Glossaries** help the agent understand the meaning of domain-specific vocabulary that the user may use while interacting with the agent.\n\n```typescript\nagent campaignAnalyzer {\n    role \"marketing_analyst\",\n    instruction \"Evaluate and optimize marketing campaign performance based on key performance indicators (KPIs) and assign a performance rating\",\n    tools acme/campaign_eval,\n    // ...\n}\n\nglossaryEntry campaignAnalyzer.entry1 {\n    word \"outstanding\",\n    meaning \"CTR ≥ 5%, Conversion Rate ≥ 10%, ROI ≥ 50%\",\n    synonyms \"exceptional, high-impact\"\n}\n\nglossaryEntry campaignAnalyzer.entry2 {\n    word \"satisfactory\",\n    meaning \"CTR 2-4.9%, Conversion Rate 5-9.9%, ROI 20-49%\",\n    synonyms \"solid, effective\"\n}\n\nglossaryEntry campaignAnalyzer.entry3 {\n    word \"underperforming\",\n    meaning \"CTR \u003c 2%, Conversion Rate \u003c 5%, ROI \u003c 20%\",\n    synonyms \"needs improvement, low-impact\"\n}\n```\n\n\u003cdiv align=\"center\"\u003e\n\n## Agentlang Ontology\n\n\u003c/div\u003e\n\nAgentlang's sophisticated modeling capabilities allow you to design the data-schema, workflows and access control constructs of your application in a declarative way. Agents can work directly with this ontology and dynamically generate business workflows, making your application into a living system that constantly adapts to new requirements and demands.\n\nThis simple blogging application demonstrates Agentlang’s powerful data modeling and agent integration capabilities.\n\n```typescript\nmodule blog.core\n\nentity Post {\n    id UUID @id @default(uuid()),\n    title String,\n    content String,\n    postedBy Email,\n    createdAt DateTime @default(now()),\n    @rbac [(roles: [manager], allow: [create, read])]\n}\n\nentity Comment {\n   id UUID @id @default(uuid()),\n   content String,\n   postedBy Email,\n   postedOn DateTime @default(now())\n}\n\nrelationship PostComment contains(Post, Comment)\n\nentity Category {\n    id UUID @id @default(uuid()),\n    name String\n}\n\nrelationship PostCategory between(Post, Category)\n\n@public agent postEditor {\n    role \"content_editor\",\n    instruction \"Create a new blog post based on the outline provided to you.\",\n    tools [blog.core/Post]\n}\n```\n\nEntities like `Post`, `Comment`, and `Category` define a clear domain schema connected through declarative relationships such as `contains` and `between`. Access rules, like the `@rbac` annotation on posts, show how policies can be built directly into the model itself.\n\nWhat makes this model special is how seamlessly an agent can interact with it — for instance, the `postEditor` agent can create new posts directly using the `Post` entity as a tool. This tight coupling between schema and agent logic allows intelligent automation to operate safely and predictably within a structured data framework.\n\nTo get started with Agentlang Ontology, please see the [Agentlang Tutorial](https://docs.fractl.io/app) or explore the following example applications:\n\n * [Car Dealership](https://github.com/agentlang-ai/agentlang/tree/main/example/car_dealership)\n * [Customer Support System](https://github.com/agentlang-ai/agentlang/tree/main/example/customer_support_system)\n\n## 🚀 Getting Started\n\n### Installation\n\nInstall the Agentlang CLI globally using npm:\n\n```shell\nnpm i -g @agentlang/cli\n```\n\n### Running Agentlang Applications\n\n```shell\n# switch to example directory where package.json is located\ncd example/blog\n\n# Parse and validate an Agentlang file present in that directory\nagent parseAndValidate blog.al\n\n# Run the app\nagent run\n```\n\n## 👨‍💻 Development\n\nFor contributors who want to build and develop Agentlang itself:\n\n### Setup\n\n```shell\n# Install dependencies\nnpm install\n\nOR\n\n# Install pnpm: https://pnpm.io/installation\n# Use pnpm\npnpm install\n```\n**Note**: If pnpm shows build script warnings, run `pnpm approve-builds` and approve esbuild and sqlite3.\n\n### ⚡ Build\n\n```shell\n# Generate parser and build\nnpm run langium:generate\nnpm run build\n```\n\n### ⚡ Test\n\n```shell\n# Run all tests\nnpm test\n\n# Run tests with verbose output\nnpm run test:verbose\n```\n\n### Run from Source\n\n```shell\n# Parse and validate an Agentlang file\nnode ./bin/cli.js parseAndValidate example/blog/blog.al\n\n# Run a specific app\nnode ./bin/cli.js run example/blog\n```\n\n### Code Quality\n\n```shell\n# Lint code\nnpm run lint\n\n# Lint and auto-fix issues\nnpm run lint:fix\n\n# Format code\nnpm run format\n\n# Check formatting without changes\nnpm run format:check\n```\n\n### Watch Mode\n\n```shell\n# Watch for changes and rebuild\nnpm run watch\n```\n","funding_links":[],"categories":["JVM语言"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fagentlang-ai%2Fagentlang","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fagentlang-ai%2Fagentlang","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fagentlang-ai%2Fagentlang/lists"}