agentica 0.20.0 → 0.21.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (3) hide show
  1. package/README.md +141 -42
  2. package/dist/index.mjs +1 -1
  3. package/package.json +1 -1
package/README.md CHANGED
@@ -1,66 +1,165 @@
1
- # Agentica CLI Tool
1
+ # Agentica, AI Function Calling Framework
2
2
 
3
- ```bash
4
- npx agentica start <directory>
5
- npx agentica backend <directory>
6
- npx agentica client <directory>
7
- ```
3
+ <!-- https://github.com/user-attachments/assets/5326cc59-5129-470d-abcb-c3f458b5c488 -->
8
4
 
9
- [![GitHub license](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/wrtnlabs/agentica/blob/master/LICENSE)
10
- [![npm version](https://img.shields.io/npm/v/agentica.svg)](https://www.npmjs.com/package/agentica)
11
- [![Downloads](https://img.shields.io/npm/dm/agentica.svg)](https://www.npmjs.com/package/agentica)
5
+ ![Logo](https://wrtnlabs.io/agentica/og.jpg?refresh)
6
+
7
+ [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/wrtnlabs/agentica/blob/master/LICENSE)
8
+ [![NPM Version](https://img.shields.io/npm/v/@agentica/core.svg)](https://www.npmjs.com/package/@agentica/core)
9
+ [![NPM Downloads](https://img.shields.io/npm/dm/@agentica/core.svg)](https://www.npmjs.com/package/@agentica/core)
12
10
  [![Build Status](https://github.com/wrtnlabs/agentica/workflows/build/badge.svg)](https://github.com/wrtnlabs/agentica/actions?query=workflow%3Abuild)
11
+ [![Guide Documents](https://img.shields.io/badge/Guide-Documents-forestgreen)](https://wrtnlabs.io/agentica/)
12
+ [![Discord Badge](https://dcbadge.limes.pink/api/server/https://discord.gg/aMhRmzkqCx?style=flat)](https://discord.gg/aMhRmzkqCx)
13
+
14
+ Agentic AI framework specialized in AI Function Calling.
13
15
 
14
- Agentica CLI Tool cloning boilerplate project.
16
+ Don't be afraid of AI agent development. Just list functions from three protocols below. This is everything you should do for AI agent development.
15
17
 
16
- - `start`: a frontend application creating agent in browser
17
- - `backend`: backend application serving the agent through websocket protocol
18
- - `client`: frontend application connecting to above websocket server
18
+ - TypeScript Class
19
+ - Swagger/OpenAPI Document
20
+ - MCP (Model Context Protocol) Server
19
21
 
20
- ## Introduction
22
+ Wanna make an e-commerce agent? Bring in e-commerce functions. Need a newspaper agent? Get API functions from the newspaper company. Just prepare any functions that you need, then it becomes an AI agent.
21
23
 
22
- ![agentica-conceptual-diagram](https://github.com/user-attachments/assets/d7ebbd1f-04d3-4b0d-9e2a-234e29dd6c57)
24
+ Are you a TypeScript developer? Then you're already an AI developer. Familiar with backend development? You're already well-versed in AI development. Anyone who can make functions can make AI agents.
25
+
26
+ <!-- eslint-skip -->
23
27
 
24
28
  ```typescript
25
- import { Agentica } from "@agentica/core";
29
+ import { Agentica, assertHttpLlmApplication } from "@agentica/core";
30
+ import OpenAI from "openai";
26
31
  import typia from "typia";
27
32
 
33
+ import { MobileFileSystem } from "./services/MobileFileSystem";
34
+
28
35
  const agent = new Agentica({
36
+ vendor: {
37
+ api: new OpenAI({ apiKey: "********" }),
38
+ model: "gpt-4o-mini",
39
+ },
29
40
  controllers: [
30
- await fetch(
31
- "https://shopping-be.wrtn.ai/editor/swagger.json",
32
- ).then(r => r.json()),
33
- typia.llm.application<ShoppingCounselor>(),
34
- typia.llm.application<ShoppingPolicy>(),
35
- typia.llm.application<ShoppingSearchRag>(),
41
+ // functions from TypeScript class
42
+ {
43
+ protocol: "http",
44
+ application: typia.llm.application<MobileFileSystem, "chatgpt">(),
45
+ execute: new MobileFileSystem(),
46
+ },
47
+ // functions from Swagger/OpenAPI
48
+ {
49
+ protocol: "http",
50
+ application: assertHttpLlmApplication({
51
+ model: "chatgpt",
52
+ document: await fetch(
53
+ "https://shopping-be.wrtn.ai/editor/swagger.json",
54
+ ).then(r => r.json()),
55
+ }),
56
+ connection: {
57
+ host: "https://shopping-be.wrtn.ai",
58
+ headers: { Authorization: "Bearer ********" },
59
+ },
60
+ },
36
61
  ],
37
62
  });
38
63
  await agent.conversate("I wanna buy MacBook Pro");
39
64
  ```
40
65
 
41
- The simplest **Agentic AI** library, specialized in **LLM Function Calling**.
66
+ ## 📦 Setup
42
67
 
43
- Don't compose complicate agent graph or workflow, but just deliver **Swagger/OpenAPI** documents or **TypeScript class** types linearly to the `@agentica`. Then `@agentica` will do everything with the function calling.
68
+ ```bash
69
+ $ npx agentica start <directory>
44
70
 
45
- Look at the below demonstration, and feel how `@agentica` is easy and powerful.
71
+ ----------------------------------------
72
+ Agentica Setup Wizard
73
+ ----------------------------------------
74
+ ? Package Manager (use arrow keys)
75
+ > npm
76
+ pnpm
77
+ yarn (berry is not supported)
78
+ ? Project Type
79
+ NodeJS Agent Server
80
+ > NestJS Agent Server
81
+ React Client Application
82
+ Standalone Application
83
+ ? Embedded Controllers (multi-selectable)
84
+ (none)
85
+ Google Calendar
86
+ Google News
87
+ > Github
88
+ Reddit
89
+ Slack
90
+ ...
91
+ ```
46
92
 
47
- ```typescript
48
- import { Agentica } from "@agentica/core";
49
- import typia from "typia";
93
+ The setup wizard helps you create a new project tailored to your needs.
50
94
 
51
- const agent = new Agentica({
52
- controllers: [
53
- await fetch(
54
- "https://shopping-be.wrtn.ai/editor/swagger.json",
55
- ).then(r => r.json()),
56
- typia.llm.application<ShoppingCounselor>(),
57
- typia.llm.application<ShoppingPolicy>(),
58
- typia.llm.application<ShoppingSearchRag>(),
59
- ],
60
- });
61
- await agent.conversate("I wanna buy MacBook Pro");
95
+ For reference, when selecting a project type, any option other than "Standalone Application" will implement the [WebSocket Protocol](https://wrtnlabs.io/agentica/docs/websocket/) for client-server communication.
96
+
97
+ For comprehensive setup instructions, visit our [Getting Started](https://wrtnlabs.io/agentica/docs/) guide.
98
+
99
+ ## 💻 Playground
100
+
101
+ Experience Agentica firsthand through our [interactive playground](https://wrtnlabs.io/agentica/playground) before installing.
102
+
103
+ Our demonstrations showcase the power and simplicity of Agentica's function calling capabilities across different integration methods.
104
+
105
+ - [TypeScript Class](https://wrtnlabs.io/agentica/playground/bbs)
106
+ - [Swagger/OpenAPI Document](https://wrtnlabs.io/agentica/playground/swagger)
107
+ - [Enterprise E-commerce Agent](https://wrtnlabs.io/agentica/playground/shopping)
108
+
109
+ <!--
110
+ @todo this section would be changed after making tutorial playground
111
+ -->
112
+
113
+ ## 📚 Documentation Resources
114
+
115
+ Find comprehensive resources at our [official website](https://wrtnlabs.io/agentica).
116
+
117
+ - [Home](https://wrtnlabs.io/agentica)
118
+ - [Guide Documents](https://wrtnlabs.io/agentica/docs)
119
+ - [Tutorial](https://wrtnlabs.io/agentica/tutorial)
120
+ - [API Documents](https://wrtnlabs.io/agentica/api)
121
+ - [Youtube](https://www.youtube.com/@wrtnlabs)
122
+ - [Paper](https://wrtnlabs.io/agentica/paper)
123
+
124
+ ## 🌟 Why Agentica?
125
+
126
+ ```mermaid
127
+ flowchart
128
+ subgraph "JSON Schema Specification"
129
+ schemav4("JSON Schema v4 ~ v7") --upgrades--> emended[["OpenAPI v3.1 (emended)"]]
130
+ schema2910("JSON Schema 2019-03") --upgrades--> emended
131
+ schema2020("JSON Schema 2020-12") --emends--> emended
132
+ end
133
+ subgraph "Agentica"
134
+ emended --"Artificial Intelligence"--> fc{{"AI Function Calling"}}
135
+ fc --"OpenAI"--> chatgpt("ChatGPT")
136
+ fc --"Google"--> gemini("Gemini")
137
+ fc --"Anthropic"--> claude("Claude")
138
+ fc --"High-Flyer"--> deepseek("DeepSeek")
139
+ fc --"Meta"--> llama("Llama")
140
+ chatgpt --"3.1"--> custom(["Custom JSON Schema"])
141
+ gemini --"3.0"--> custom(["Custom JSON Schema"])
142
+ claude --"3.1"--> standard(["Standard JSON Schema"])
143
+ deepseek --"3.1"--> standard
144
+ llama --"3.1"--> standard
145
+ end
62
146
  ```
63
147
 
64
- > https://github.com/user-attachments/assets/01604b53-aca4-41cb-91aa-3faf63549ea6
65
- >
66
- > Demonstration video of Shopping AI Chatbot
148
+ Agentica enhances AI function calling by the following strategies:
149
+
150
+ - [**Compiler Driven Development**](https://wrtnlabs.io/agentica/docs/concepts/compiler-driven-development): constructs function calling schema automatically by compiler skills without hand-writing.
151
+ - [**JSON Schema Conversion**](https://wrtnlabs.io/agentica/docs/core/vendor/#schema-specification): automatically handles specification differences between LLM vendors, ensuring seamless integration regardless of your chosen AI model.
152
+ - [**Validation Feedback**](https://wrtnlabs.io/agentica/docs/concepts/function-calling#validation-feedback): detects and corrects AI mistakes in argument composition, dramatically reducing errors and improving reliability.
153
+ - [**Selector Agent**](https://wrtnlabs.io/agentica/docs/concepts/function-calling#orchestration-strategy): filtering candidate functions to minimize context usage, optimize performance, and reduce token consumption.
154
+
155
+ Thanks to these innovations, Agentica makes AI function calling easier, safer, and more accurate than before. Development becomes more intuitive since you only need to prepare functions relevant to your specific use case, and scaling your agent's capabilities is as simple as adding or removing functions.
156
+
157
+ In 2023, when OpenAI announced function calling, many predicted that function calling-driven AI development would become the mainstream. However, in reality, due to the difficulty and instability of function calling, the trend in AI development became agent workflow. Agent workflow, which is inflexible and must be created for specific purposes, has conquered the AI agent ecosystem.
158
+ By the way, as Agentica has resolved the difficulty and instability problems of function calling, the time has come to embrace function-driven AI development once again.
159
+
160
+ | Type | Workflow | Vanilla Function Calling | Agentica Function Calling |
161
+ | ----------- | ------------- | ------------------------ | ------------------------- |
162
+ | Purpose | ❌ Specific | 🟢 General | 🟢 General |
163
+ | Difficulty | ❌ Difficult | ❌ Difficult | 🟢 Easy |
164
+ | Stability | 🟢 Stable | ❌ Unstable | 🟢 Stable |
165
+ | Flexibility | ❌ Inflexible | 🟢 Flexible | 🟢 Flexible |
package/dist/index.mjs CHANGED
@@ -93,4 +93,4 @@ execute: new ${s}Service(),
93
93
  `)),e=Tt({content:a,importCode:s,connectorCode:r}),o=await Ot(e);await ht(i,o),await Ue({projectPath:u,apiKeys:[{key:"OPENAI_API_KEY",value:t.openAIKey??""},{key:"API_PORT",value:t.port?.toString()??"3000"},...t.envList??[]]}),fe.success("\u2705 .env created"),await ze({packageManager:t.packageManager,projectAbsolutePath:u,services:t.services}),await vi({packageManager:t.packageManager,projectAbsolutePath:u})}async function Ai({projectAbsolutePath:u,context:t}){await je({template:"react",project:u}),fe.success("\u2705 Template downloaded"),await Ue({projectPath:u,apiKeys:[{key:"OPENAI_API_KEY",value:t.openAIKey??""},{key:"VITE_AGENTICA_WS_URL",value:`ws://localhost:${t.port}/chat`}]}),fe.success("\u2705 .env created"),await ze({packageManager:t.packageManager,projectAbsolutePath:u,services:t.services})}async function bu({projectAbsolutePath:u,context:t}){await je({template:"react-native",project:u}),fe.success("\u2705 Template downloaded"),await Ue({projectPath:u,apiKeys:[{key:"OPENAI_API_KEY",value:t.openAIKey??""}]}),fe.success("\u2705 .env created"),await ze({packageManager:t.packageManager,projectAbsolutePath:u,services:t.services})}async function _u({template:u}){ss("Agentica Start Wizard");const t=await Fu({template:u}),{projectAbsolutePath:s}=t;switch(t.template){case"standalone":await yu({projectAbsolutePath:s,context:t});break;case"nodejs":await gr({projectAbsolutePath:s,context:t});break;case"nestjs":await Cr({projectAbsolutePath:s,context:t});break;case"react":await Ai({projectAbsolutePath:s,context:t});break;case"react-native":await bu({projectAbsolutePath:s,context:t});break;case"nestjs+react":await Cr({projectAbsolutePath:be(s,"server"),context:t}),await Ai({projectAbsolutePath:be(s,"client"),context:t});break;case"nodejs+react":await gr({projectAbsolutePath:be(s,"server"),context:t}),await Ai({projectAbsolutePath:be(s,"client"),context:t});break;default:throw t.template,new Error(`\u274C Template ${t.template} not supported`)}Fn(`
94
94
  \u{1F389} Project ${s} created
95
95
  \u26A0\uFE0F ${pe.yellow("Note:")} Please implement constructor values for each controller generated in index.ts
96
- `)}const wu="0.20.0",nt=new An;nt.version(wu),nt.command("start").description("Start a new project").addOption(new Sn("-p, --project <project>","The project type").choices(Cu)).action(async u=>{ss(`\u{1F680} ${pe.blueBright("Agentica")} Setup Wizard`),await _u({template:u.project})});function vu(){nt.parse(ae.argv)}export{nt as program,vu as run};
96
+ `)}const wu="0.21.0",nt=new An;nt.version(wu),nt.command("start").description("Start a new project").addOption(new Sn("-p, --project <project>","The project type").choices(Cu)).action(async u=>{ss(`\u{1F680} ${pe.blueBright("Agentica")} Setup Wizard`),await _u({template:u.project})});function vu(){nt.parse(ae.argv)}export{nt as program,vu as run};
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "agentica",
3
3
  "type": "module",
4
- "version": "0.20.0",
4
+ "version": "0.21.0",
5
5
  "description": "Agentic AI Library specialized in LLM Function Calling",
6
6
  "author": "Wrtn Technologies",
7
7
  "license": "MIT",