{"id":45875985,"url":"https://github.com/axar-ai/axar","last_synced_at":"2026-03-12T22:01:55.063Z","repository":{"id":270971031,"uuid":"911950759","full_name":"axar-ai/axar","owner":"axar-ai","description":"Minimal typescript agent framework that keeps it simple and gives you control - no BS","archived":false,"fork":false,"pushed_at":"2026-02-09T21:07:32.000Z","size":1875,"stargazers_count":154,"open_issues_count":4,"forks_count":13,"subscribers_count":5,"default_branch":"main","last_synced_at":"2026-02-10T00:58:30.087Z","etag":null,"topics":["agent-framework","agent-framework-javascript","agentic-ai","agents","ai","generative-ai","javascript","llm","llm-framework","nodejs","typescript","workflows"],"latest_commit_sha":null,"homepage":"https://axar.ai","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/axar-ai.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","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":null,"dco":null,"cla":null}},"created_at":"2025-01-04T09:33:17.000Z","updated_at":"2026-02-09T21:07:12.000Z","dependencies_parsed_at":null,"dependency_job_id":"5f35f7fc-772a-496b-a3ef-400bb163c26f","html_url":"https://github.com/axar-ai/axar","commit_stats":null,"previous_names":["axar-ai/axar-core","axar-ai/axar"],"tags_count":9,"template":false,"template_full_name":null,"purl":"pkg:github/axar-ai/axar","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/axar-ai%2Faxar","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/axar-ai%2Faxar/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/axar-ai%2Faxar/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/axar-ai%2Faxar/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/axar-ai","download_url":"https://codeload.github.com/axar-ai/axar/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/axar-ai%2Faxar/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":30446425,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-12T21:31:01.033Z","status":"ssl_error","status_checked_at":"2026-03-12T21:30:43.161Z","response_time":114,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: 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":["agent-framework","agent-framework-javascript","agentic-ai","agents","ai","generative-ai","javascript","llm","llm-framework","nodejs","typescript","workflows"],"created_at":"2026-02-27T12:00:30.176Z","updated_at":"2026-03-12T22:01:55.046Z","avatar_url":"https://github.com/axar-ai.png","language":"TypeScript","readme":"\u003cp align=\"center\"\u003e\n  \u003cimg src=\"https://1845789600-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FEsqZ01bZEklboQR0Pa9C%2Fuploads%2FzA1p5nNK5LK1Nlo8yjxh%2FColor%20logo%20with%20background.svg?alt=media\u0026token=df4fd20a-d9be-4994-99b7-8ae3f9f558cb\" alt=\"AXAR Logo\" width=\"360\"\u003e\n\u003c/p\u003e\n\n\u003cdiv align=\"center\" style=\"margin-bottom: 16px;\"\u003e\n  \u003ca href=\"https://axar-ai.gitbook.io/axar\"\u003e\u003cimg src=\"https://img.shields.io/badge/GitBook-Docu-lightblue\" alt=\"Documentation\"\u003e\u003c/a\u003e\n  \u003ca href=\"https://github.com/axar-ai/axar/actions/workflows/ci.yml?query=branch%3Amain\"\u003e\u003cimg src=\"https://github.com/axar-ai/axar/actions/workflows/ci.yml/badge.svg?event=push\" alt=\"CI\"\u003e\u003c/a\u003e\n  \u003ca href='https://coveralls.io/github/axar-ai/axar?branch=main'\u003e\u003cimg src='https://coveralls.io/repos/github/axar-ai/axar/badge.svg?branch=main' alt='Coverage Status' /\u003e\u003c/a\u003e\n  \u003ca href=\"https://www.npmjs.com/package/@axarai/axar\"\u003e\u003cimg alt=\"NPM Version\" src=\"https://img.shields.io/npm/v/%40axarai%2Faxar\"\u003e\u003c/a\u003e\n  \u003ca href=\"https://www.npmjs.com/package/@axarai/axar\"\u003e\u003cimg alt=\"NPM download\" src=\"https://img.shields.io/npm/dw/%40axarai%2Faxar\"\u003e\u003c/a\u003e\n  \u003ca href=\"https://github.com/axar-ai/axar/blob/main/LICENSE\"\u003e\u003cimg src=\"https://img.shields.io/github/license/axar-ai/axar\" alt=\"license\"\u003e\u003c/a\u003e\n\u003c/div\u003e\n\u003cbr/\u003e\n\n**AXAR AI** is a lightweight framework for building production-ready agentic applications using TypeScript. It’s designed to help you create robust, production-grade LLM-powered apps using familiar coding practices—no unnecessary abstractions, no steep learning curve.\n\n## ⌾ Yet another framework?\n\nMost agent frameworks are overcomplicated. And many prioritize flashy demos over practical use, making it harder to debug, iterate, and trust in production. Developers need tools that are simple to work with, reliable, and easy to integrate into existing workflows.\n\nAt its core, AXAR is built around code. Writing explicit, structured instructions is the best way to achieve clarity, control, and precision—qualities that are essential when working in the unpredictable world LLMs.\n\nIf you’re building real-world AI applications, AXAR gets out of your way and lets you focus on shipping reliable software.\n\n### 🌍 Hello world!\n\nHere's a minimal example of an AXAR agent:\n\n```ts\nimport { model, systemPrompt, Agent } from '@axarai/axar';\n\n// Define the agent.\n@model('openai:gpt-4o-mini')\n@systemPrompt('Be concise, reply with one sentence')\nexport class SimpleAgent extends Agent\u003cstring, string\u003e {}\n\n// Run the agent.\nasync function main() {\n  const response = await new SimpleAgent().run(\n    'Where does \"hello world\" come from?',\n  );\n  console.log(response);\n}\n\nmain().catch(console.error);\n```\n\n## Why use AXAR\n\n- **🧩 Type-first design**: Structured, typed inputs and outputs with TypeScript (Zod or @annotations) for predictable and reliable agent workflows.\n\n- **🛠️ Familiar and intuitive**: Built on patterns like dependency injection and decorators, so you can use what you already know.\n\n- **🎛️ Explicit control**: Define agent behavior, guardrails, and validations directly in code for clarity and maintainability.\n\n- **🔍 Transparent**: Includes tools for real-time logging and monitoring, giving you full control and insight into agent operations.\n\n- **🪶 Minimalistic**: Lightweight minimal design with little to no overhead for your codebase.\n\n- **🌐 Model agnostic**: Works with OpenAI, Anthropic, Gemini, and more, with easy extensibility for additional models.\n\n- **🚀 Streamed outputs**: Streams LLM responses with built-in validation for fast and accurate results.\n\n## Resources\n\n- [📕 AXAR AI Documentation ↗](https://axar-ai.gitbook.io/axar)\n- [💬 Discord](https://discord.gg/4h8fUZTWD9)\n- [👔 LinkedIn](https://www.linkedin.com/company/axar-ai/)\n- [🐙 GitHub](https://github.com/axar-ai)\n\n## Usage\n\n### 1. Configure your project\n\nSet up a new project and install the required dependencies:\n\n```bash\nmkdir axar-demo\ncd axar-demo\nnpm init -y\nnpm i @axarai/axar ts-node typescript\nnpx tsc --init\n```\n\n\u003e [!WARNING]\n\u003e You need to configure your `tsconfig.json` file as follows for better compatibility:\n\u003e\n\u003e ```json\n\u003e {\n\u003e   \"compilerOptions\": {\n\u003e     \"strict\": true,\n\u003e     \"module\": \"CommonJS\",\n\u003e     \"target\": \"es2020\",\n\u003e     \"esModuleInterop\": true,\n\u003e     \"experimentalDecorators\": true,\n\u003e     \"emitDecoratorMetadata\": true\n\u003e   }\n\u003e }\n\u003e ```\n\n### 2. Write your first agent\n\nCreate a new file `text-agent.ts` and add the following code:\n\n```ts\nimport { model, systemPrompt, Agent } from '@axarai/axar';\n\n@model('openai:gpt-4o-mini')\n@systemPrompt('Be concise, reply with one sentence')\nclass TextAgent extends Agent\u003cstring, string\u003e {}\n\n(async () =\u003e {\n  const response = await new TextAgent().run('Who invented the internet?');\n  console.log(response);\n})();\n```\n\n### 3. Run the agent\n\n```bash\nexport OPENAI_API_KEY=\"sk-proj-YOUR-API-KEY\"\nnpx ts-node text-agent.ts\n```\n\n\u003e [!WARNING]\n\u003e AXAR currently requires ts-node because tsx does not yet fully support experimental decorators.\n\n## In-depth example\n\nYou can easily extend AXAR agents with tools, dynamic prompts, and structured responses to build more robust and flexible agents.\n\n### 💬 Bank agent (dynamic prompts, tools, structured data, and DI)\n\nHere's a more complex example (truncated to fit in this README):\n\n[Full code here](./examples/bank-agent/bank-agent-with-schema.ts)\n\n\u003cp align=\"center\"\u003e\n  \u003cimg src=\"https://1845789600-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FEsqZ01bZEklboQR0Pa9C%2Fuploads%2F1w7BWzdiMjXduOh0KAzW%2Fbank-agent.svg?alt=media\u0026token=dcc90aa0-3119-4ecd-9f03-991f7dc99a35\"\u003e\n\u003c/p\u003e\n\n```ts\n// ...\n// Define the structured response that the agent will produce.\n@schema()\nexport class SupportResponse {\n  @property('Human-readable advice to give to the customer.')\n  support_advice!: string;\n\n  @property(\"Whether to block customer's card.\")\n  block_card!: boolean;\n\n  @property('Risk level of query')\n  @min(0)\n  @max(1)\n  risk!: number;\n\n  @property(\"Customer's emotional state\")\n  @optional()\n  status?: 'Happy' | 'Sad' | 'Neutral';\n}\n\n// Define the schema for the parameters used by tools (functions accessible to the agent).\n@schema()\nclass ToolParams {\n  @property(\"Customer's name\")\n  customerName!: string;\n\n  @property('Whether to include pending transactions')\n  @optional()\n  includePending?: boolean;\n}\n\n// Specify the AI model used by the agent (e.g., OpenAI GPT-4 mini version).\n@model('openai:gpt-4o-mini')\n// Provide a system-level prompt to guide the agent's behavior and tone.\n@systemPrompt(`\n  You are a support agent in our bank. \n  Give the customer support and judge the risk level of their query.\n  Reply using the customer's name.\n`)\n// Define the expected output format of the agent.\n@output(SupportResponse)\nexport class SupportAgent extends Agent\u003cstring, SupportResponse\u003e {\n  // Initialize the agent with a customer ID and a DB connection for fetching customer-specific data.\n  constructor(\n    private customerId: number,\n    private db: DatabaseConn,\n  ) {\n    super();\n  }\n\n  // Provide additional context for the agent about the customer's details.\n  @systemPrompt()\n  async getCustomerContext(): Promise\u003cstring\u003e {\n    // Fetch the customer's name from the database and provide it as context.\n    const name = await this.db.customerName(this.customerId);\n    return `The customer's name is '${name}'`;\n  }\n\n  // Define a tool (function) accessible to the agent for retrieving the customer's balance.\n  @tool(\"Get customer's current balance\")\n  async customerBalance(params: ToolParams): Promise\u003cnumber\u003e {\n    // Fetch the customer's balance, optionally including pending transactions.\n    return this.db.customerBalance(\n      this.customerId,\n      params.customerName,\n      params.includePending ?? true,\n    );\n  }\n}\n\nasync function main() {\n  // Mock implementation of the database connection for this example.\n  const db: DatabaseConn = {\n    async customerName(id: number) {\n      // Simulate retrieving the customer's name based on their ID.\n      return 'John';\n    },\n    async customerBalance(\n      id: number,\n      customerName: string,\n      includePending: boolean,\n    ) {\n      // Simulate retrieving the customer's balance with optional pending transactions.\n      return 123.45;\n    },\n  };\n\n  // Initialize the support agent with a sample customer ID and the mock database connection.\n  const agent = new SupportAgent(123, db);\n\n  // Run the agent with a sample query to retrieve the customer's balance.\n  const balanceResult = await agent.run('What is my balance?');\n  console.log(balanceResult);\n\n  // Run the agent with a sample query to block the customer's card.\n  const cardResult = await agent.run('I just lost my card!');\n  console.log(cardResult);\n}\n\n// Entry point for the application. Log any errors that occur during execution.\nmain().catch(console.error);\n```\n\n## More examples\n\nMore examples can be found in the [examples](./examples) directory.\n\n## Setting up for contribution\n\n- **Install dependencies**: `npm install`\n- **Build**: `npm run build`\n- **Run tests**: `npm run test`\n\n## Contributing\n\nWe welcome contributions from the community. Please see the [CONTRIBUTING.md](CONTRIBUTING.md) file for more information. We run regular workshops and events to help you get started. Join our [Discord](https://discord.gg/4h8fUZTWD9) to stay in the loop.\n\n## Inspirations\n\nAXAR is built on ideas from some of the best tools and frameworks out there. We use Vercel's AI SDK and take inspiration from [Pydantic AI](https://github.com/pydantic/pydantic-ai) and OpenAI’s [Swarm](https://github.com/openai/swarm). These projects have set the standard for developer-friendly AI tooling, and AXAR builds on that foundation.\n\n\u003e [!WARNING]\n\u003e AXAR AI (axar) is currently in early alpha. It is not intended to be used in production as of yet. But we're working hard to get there and we would love your help!\n","funding_links":[],"categories":["Frameworks"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faxar-ai%2Faxar","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Faxar-ai%2Faxar","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faxar-ai%2Faxar/lists"}