art-framework 0.4.7 → 0.4.11
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.
- package/README.md +54 -123
- package/dist/index.cjs +58 -51
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +1174 -37
- package/dist/index.d.ts +1174 -37
- package/dist/index.js +58 -51
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -1,6 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
# ✨ ART: Agentic Runtime Framework (beta) <img src="https://img.shields.io/badge/Version-v0.4.7-blue" alt="Version 0.4.7">
|
|
1
|
+
# ✨ ART: Agentic Runtime Framework <img src="https://img.shields.io/badge/Version-v0.4.11-blue" alt="Version 0.4.11">
|
|
4
2
|
|
|
5
3
|
<p align="center">
|
|
6
4
|
<img src="docs/art-logo.jpeg" alt="ART Framework Logo" width="200"/>
|
|
@@ -9,60 +7,42 @@
|
|
|
9
7
|
<img src="docs/art-banner.png" alt="ART Framework Overview" width="100%"/>
|
|
10
8
|
</p>
|
|
11
9
|
|
|
12
|
-
**ART is a powerful, modular, and browser-first TypeScript framework for building sophisticated LLM-powered agents capable of complex reasoning, planning, and tool usage.**
|
|
10
|
+
**ART (Agentic Reactive Triad) is a powerful, modular, and browser-first TypeScript framework for building sophisticated LLM-powered agents capable of complex reasoning, planning, and tool usage.**
|
|
13
11
|
|
|
14
|
-
It provides the
|
|
12
|
+
It provides the missing runtime for production-ready agentic systems, emphasizing **Reliability**, **Observability**, and **Resilience**.
|
|
15
13
|
|
|
16
14
|
[](https://opensource.org/licenses/MIT)
|
|
17
15
|
[](http://makeapullrequest.com)
|
|
18
16
|
|
|
19
17
|
[](https://www.patreon.com/HashanWickramasinghe)
|
|
20
18
|
|
|
21
|
-
##
|
|
19
|
+
## The Reactive Triad
|
|
22
20
|
|
|
23
|
-
|
|
21
|
+
ART is architected around three core nodes that ensure your agents are production-ready:
|
|
24
22
|
|
|
25
|
-
**
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
* **Observability:** Provide deep, real-time insights into the agent's internal thought process.
|
|
29
|
-
* **Developer Experience:** Deliver a layered API that is simple for basic use cases yet powerful enough for advanced customization.
|
|
23
|
+
1. **Reactive Agent (Orchestration):** The flagship `PESAgent` uses a **Plan-Execute-Synthesize** workflow to handle complex, multi-step tasks with dynamic refinement.
|
|
24
|
+
2. **Persistent State (Memory):** Durable state management that persists across sessions, crashes, and human-in-the-loop pauses.
|
|
25
|
+
3. **Standardized UI (Observability):** A reactive socket system that streams granular "thoughts," tool calls, and status updates directly to your frontend.
|
|
30
26
|
|
|
31
27
|
## Key Features
|
|
32
28
|
|
|
33
|
-
#### Reasoning
|
|
34
|
-
* **
|
|
35
|
-
* **
|
|
36
|
-
* **Dynamic
|
|
37
|
-
* **
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
* **
|
|
42
|
-
* **
|
|
43
|
-
* **
|
|
44
|
-
* **Dynamic Tool Loading (MCP):** Support for the Model Context Protocol (MCP) enables agents to dynamically discover and use tools from compliant external servers.
|
|
45
|
-
|
|
46
|
-
#### Developer Experience
|
|
47
|
-
* **Browser-First Design:** Built to run fully in the browser, enabling privacy-preserving and offline-capable applications.
|
|
48
|
-
* **Flexible UI Integration:** A typed, publish/subscribe socket system allows for reactive UI updates with fine-grained event filtering.
|
|
49
|
-
* **TypeScript-Native:** Engineered from the ground up with TypeScript for a robust, type-safe development experience.
|
|
50
|
-
|
|
51
|
-
## Architecture: The 3 Nodes
|
|
52
|
-
|
|
53
|
-
ART's architecture is best understood as three interconnected nodes:
|
|
54
|
-
|
|
55
|
-
```mermaid
|
|
56
|
-
flowchart LR
|
|
57
|
-
A["Node 1: Developer Interface\n(Your Code & Config)"] -- Configures & Invokes --> B["Node 2: ART Core Orchestration\n(The Framework's Brain)"]
|
|
58
|
-
B -- Manages & Uses --> C["Node 3: External Dependencies & Interactions\n(LLMs, Tools, Storage)"]
|
|
59
|
-
C -- Provides Data/Services --> B
|
|
60
|
-
B -- Streams Results/Updates --> A
|
|
61
|
-
```
|
|
29
|
+
#### 🧠 Advanced Reasoning (PES Agent)
|
|
30
|
+
* **Structured Planning:** Decomposes user intent into a discrete `TodoList` with dependency mapping.
|
|
31
|
+
* **TAEF (Tool-Aware Execution Framework):** Strictly validates tool usage to eliminate hallucinations and ensure protocol adherence.
|
|
32
|
+
* **Dynamic Refinement:** Self-correcting plans that adapt in real-time based on tool outputs.
|
|
33
|
+
* **Synthesis Engine:** Aggregates task results into rich responses with UI metadata and citations.
|
|
34
|
+
|
|
35
|
+
#### 🛡️ Production Robustness
|
|
36
|
+
* **HITL V2 (Human-in-the-Loop):** Seamlessly pause execution for human approval with full state preservation and resumption.
|
|
37
|
+
* **Crash Recovery:** Automatic state hydration ensures agents resume exactly where they left off.
|
|
38
|
+
* **A2A (Agent-to-Agent) Delegation:** Coordinate complex workflows by delegating sub-tasks to specialized agents.
|
|
39
|
+
* **Step Output Table:** Persists all historical tool results for consistent cross-step data access.
|
|
62
40
|
|
|
63
|
-
|
|
64
|
-
* **
|
|
65
|
-
* **
|
|
41
|
+
#### 🔌 Universal Connectivity
|
|
42
|
+
* **Multi-Provider Support:** First-class support for Gemini (Thinking), Claude (Extended Thinking), GPT (Reasoning), DeepSeek, Groq, and local models via Ollama.
|
|
43
|
+
* **MCP (Model Context Protocol):** Dynamically discover and execute tools from any MCP-compliant server.
|
|
44
|
+
* **Pluggable Storage:** Integrated adapters for IndexedDB (Browser), Supabase (Backend), and In-Memory.
|
|
45
|
+
* **OAuth & Auth Strategies:** Built-in support for PKCE, Generic OAuth, and API key management.
|
|
66
46
|
|
|
67
47
|
## Installation
|
|
68
48
|
|
|
@@ -70,106 +50,57 @@ flowchart LR
|
|
|
70
50
|
npm install art-framework
|
|
71
51
|
# or
|
|
72
52
|
pnpm install art-framework
|
|
73
|
-
# or
|
|
74
|
-
yarn add art-framework
|
|
75
53
|
```
|
|
76
54
|
|
|
77
55
|
## Quick Start
|
|
78
56
|
|
|
79
|
-
This example demonstrates setting up a simple agent that uses OpenAI and runs in-memory. For a complete example with all configurations, see the [Comprehensive Developer Guide](./docs/README.md).
|
|
80
|
-
|
|
81
57
|
```typescript
|
|
82
58
|
import {
|
|
83
59
|
createArtInstance,
|
|
84
|
-
|
|
85
|
-
ThreadConfig,
|
|
86
|
-
CalculatorTool,
|
|
60
|
+
PESAgent,
|
|
87
61
|
OpenAIAdapter,
|
|
88
|
-
|
|
62
|
+
CalculatorTool
|
|
89
63
|
} from 'art-framework';
|
|
90
64
|
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
const artConfig: ArtInstanceConfig = {
|
|
95
|
-
storage: {
|
|
96
|
-
type: 'indexedDB',
|
|
97
|
-
dbName: 'MyCorrectChatDB'
|
|
98
|
-
},
|
|
65
|
+
const art = await createArtInstance({
|
|
66
|
+
storage: { type: 'indexedDB', dbName: 'AgentDB' },
|
|
99
67
|
providers: {
|
|
100
|
-
availableProviders: [
|
|
101
|
-
{ name: 'openai', adapter: OpenAIAdapter },
|
|
102
|
-
{ name: 'gemini', adapter: GeminiAdapter }
|
|
103
|
-
]
|
|
68
|
+
availableProviders: [{ name: 'openai', adapter: OpenAIAdapter }]
|
|
104
69
|
},
|
|
105
70
|
tools: [new CalculatorTool()],
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
71
|
+
agentCore: PESAgent // Default flagship agent
|
|
72
|
+
});
|
|
73
|
+
|
|
74
|
+
// Configure the thread (Where API keys live)
|
|
75
|
+
await art.stateManager.setThreadConfig('my-thread', {
|
|
76
|
+
providerConfig: {
|
|
77
|
+
providerName: 'openai',
|
|
78
|
+
modelId: 'gpt-4o',
|
|
79
|
+
adapterOptions: { apiKey: process.env.OPENAI_API_KEY }
|
|
111
80
|
},
|
|
112
|
-
|
|
113
|
-
};
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
// --- 2. Main Application Logic ---
|
|
117
|
-
|
|
118
|
-
async function initializeAndRun() {
|
|
119
|
-
// Create the ART instance with the high-level configuration.
|
|
120
|
-
const art = await createArtInstance(artConfig);
|
|
121
|
-
console.log('ART Instance Initialized.');
|
|
122
|
-
|
|
123
|
-
// --- 3. Set Up a New Conversation Thread ---
|
|
124
|
-
const threadId = 'user-123-session-1';
|
|
125
|
-
|
|
126
|
-
// Create the thread-specific configuration.
|
|
127
|
-
// THIS is where you specify the provider, model, and API key.
|
|
128
|
-
const threadConfig: ThreadConfig = {
|
|
129
|
-
providerConfig: {
|
|
130
|
-
providerName: 'openai', // Must match a name from availableProviders
|
|
131
|
-
modelId: 'gpt-4o',
|
|
132
|
-
adapterOptions: {
|
|
133
|
-
apiKey: 'sk-your-real-openai-api-key', // Securely provide your API key here
|
|
134
|
-
temperature: 0.7
|
|
135
|
-
}
|
|
136
|
-
},
|
|
137
|
-
// Other thread settings
|
|
138
|
-
enabledTools: ['CalculatorTool'],
|
|
139
|
-
historyLimit: 20
|
|
140
|
-
};
|
|
141
|
-
|
|
142
|
-
// Save this configuration for the new thread.
|
|
143
|
-
// This step is crucial and must be done before the first `process` call.
|
|
144
|
-
await art.stateManager.setThreadConfig(threadId, threadConfig);
|
|
145
|
-
console.log(`ThreadConfig set for threadId: ${threadId}`);
|
|
146
|
-
|
|
147
|
-
// Now the ART instance is ready to process requests for this thread.
|
|
148
|
-
console.log('Sending first message...');
|
|
149
|
-
const response = await art.process({
|
|
150
|
-
query: 'What is 2 + 2?',
|
|
151
|
-
threadId: threadId
|
|
152
|
-
});
|
|
153
|
-
|
|
154
|
-
console.log('Final response:', response.response.content);
|
|
155
|
-
}
|
|
156
|
-
|
|
157
|
-
initializeAndRun().catch(console.error);
|
|
158
|
-
```
|
|
81
|
+
enabledTools: ['CalculatorTool']
|
|
82
|
+
});
|
|
159
83
|
|
|
160
|
-
|
|
84
|
+
// Process a request
|
|
85
|
+
const result = await art.process({
|
|
86
|
+
query: 'Calculate the compound interest for $1000 at 5% over 10 years.',
|
|
87
|
+
threadId: 'my-thread'
|
|
88
|
+
});
|
|
89
|
+
|
|
90
|
+
console.log(result.response.content);
|
|
91
|
+
```
|
|
161
92
|
|
|
162
93
|
## Documentation
|
|
163
94
|
|
|
164
|
-
* **[
|
|
165
|
-
* **[How-To Guides](./docs/how-to):** Practical
|
|
166
|
-
* **[API Reference](
|
|
167
|
-
* **[
|
|
95
|
+
* **[Concepts Guide](docs/concepts/pes-agent.md):** Deep dive into the PES Agent and Reactive Triad.
|
|
96
|
+
* **[How-To Guides](./docs/how-to):** Practical tutorials for [HITL](./docs/how-to/using-hitl-pausing.md), [MCP](./docs/concepts/mcp-system.md), and [Custom UI](./docs/how-to/connecting-your-ui.md).
|
|
97
|
+
* **[API Reference](https://inferq.github.io/ART/components/index.html):** Full technical documentation.
|
|
98
|
+
* **[Website](https://inferq.github.io/ART/):** Marketing site & Live Demos.
|
|
168
99
|
|
|
169
100
|
## Contributing
|
|
170
101
|
|
|
171
|
-
Contributions are welcome! Please refer to the [Contributing Guide](./CONTRIBUTING.md)
|
|
102
|
+
Contributions are welcome! Please refer to the [Contributing Guide](./CONTRIBUTING.md).
|
|
172
103
|
|
|
173
104
|
## License
|
|
174
105
|
|
|
175
|
-
ART Framework is released under the [MIT License](https://opensource.org/licenses/MIT).
|
|
106
|
+
ART Framework is released under the [MIT License](https://opensource.org/licenses/MIT).
|