@iqai/adk 0.0.1

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.
@@ -0,0 +1,8 @@
1
+ # Changesets
2
+
3
+ Hello and welcome! This folder has been automatically generated by `@changesets/cli`, a build tool that works
4
+ with multi-package repos, or single-package repos to help you version and publish your code. You can
5
+ find the full documentation for it [in our repository](https://github.com/changesets/changesets)
6
+
7
+ We have a quick list of common questions to get you started engaging with this project in
8
+ [our documentation](https://github.com/changesets/changesets/blob/main/docs/common-questions.md)
@@ -0,0 +1,11 @@
1
+ {
2
+ "$schema": "https://unpkg.com/@changesets/config@3.1.1/schema.json",
3
+ "changelog": "@changesets/cli/changelog",
4
+ "commit": false,
5
+ "fixed": [],
6
+ "linked": [],
7
+ "access": "restricted",
8
+ "baseBranch": "main",
9
+ "updateInternalDependencies": "patch",
10
+ "ignore": []
11
+ }
@@ -0,0 +1,31 @@
1
+ ---
2
+ description:
3
+ globs:
4
+ alwaysApply: true
5
+ ---
6
+ # Project Aim
7
+
8
+ ## Python to TypeScript Port
9
+
10
+ The aim of this project is to port the adk-python implementation to TypeScript (adk-ts). When porting code:
11
+
12
+ - Refer to the original implementation of the Python files
13
+ - Replicate their logic faithfully in TypeScript
14
+ - Ensure the core functionality remains identical
15
+ - Maintain the same logical structure and components
16
+
17
+ ## Requirements
18
+
19
+ 1. **Logic Preservation**: The TypeScript implementation MUST maintain the same logical flow and behavior as the Python version.
20
+
21
+ 2. **Component Naming**: Core components should maintain conceptual naming parity with the Python version.
22
+
23
+ 3. **Architecture**: Follow the same architectural patterns and separation of concerns as the Python implementation.
24
+
25
+ 4. **File Organization**: Mirror the Python project's organizational structure where appropriate, adapting to TypeScript conventions.
26
+
27
+ ## Implementation Notes
28
+
29
+ - Use TypeScript's type system to enhance the original Python implementation
30
+ - Apply language-specific best practices for TypeScript while preserving the original logic
31
+ - Adapt Python-specific patterns to TypeScript equivalents where direct ports aren't possible
@@ -0,0 +1,42 @@
1
+ ---
2
+ description:
3
+ globs:
4
+ alwaysApply: true
5
+ ---
6
+ # File Naming Conventions
7
+
8
+ ## Kebab Case for File Names
9
+
10
+ All files in this project should use kebab-case for naming. This means:
11
+
12
+ - All lowercase letters
13
+ - Words separated by hyphens
14
+ - No spaces or underscores
15
+ - No PascalCase or camelCase
16
+
17
+ ### Examples:
18
+
19
+ โœ… Good:
20
+ - `base-tool.ts`
21
+ - `google-search-tool.ts`
22
+ - `exit-loop-tool.ts`
23
+ - `llm-agent.ts`
24
+ - `memory-service.ts`
25
+
26
+ โŒ Bad:
27
+ - `BaseTool.ts`
28
+ - `GoogleSearchTool.ts`
29
+ - `exit_loop_tool.ts`
30
+ - `LlmAgent.ts`
31
+ - `memoryService.ts`
32
+
33
+ ## Class and Interface Naming
34
+
35
+ While files use kebab-case, TypeScript classes and interfaces should still follow standard conventions:
36
+
37
+ - Classes and Interfaces: PascalCase (e.g., `class BaseTool`, `interface ToolConfig`)
38
+ - Methods and Properties: camelCase (e.g., `runAsync()`, `getDeclaration()`)
39
+
40
+ ## Implementation Note
41
+
42
+ This standardization helps maintain consistency across the codebase and aligns with common TypeScript ecosystem practices.
@@ -0,0 +1,39 @@
1
+ ---
2
+ description:
3
+ globs:
4
+ alwaysApply: true
5
+ ---
6
+ # Code Documentation Guidelines
7
+
8
+ ## Commenting Philosophy
9
+
10
+ This project follows a minimalist approach to code comments, focusing on clarity through well-structured, self-documenting code.
11
+
12
+ ## Comment Guidelines
13
+
14
+ 1. **Documentation Comments Only**: Add comments only when they provide documentation value. The code itself should be clear enough to understand without excessive comments.
15
+
16
+ 2. **No Line-by-Line Comments**: Avoid explaining each line of code with a comment. This creates maintenance overhead and often becomes outdated.
17
+
18
+ 3. **Method-Level Documentation**: Place concise documentation comments above methods/functions to explain:
19
+ - Purpose of the method
20
+ - Complex logic that may not be immediately obvious
21
+ - Any important side effects
22
+
23
+ 4. **Class-Level Documentation**: Document classes with a brief description of their purpose and responsibility.
24
+
25
+ 5. **Interface Documentation**: Document interfaces with clear descriptions of their intent and contract.
26
+
27
+ ## When to Use Comments
28
+
29
+ โœ… **Good Use of Comments**:
30
+ - Explaining "why" something is done a certain way
31
+ - Documenting complex algorithms
32
+ - Flagging future enhancements (TODO comments)
33
+ - Documenting API interfaces
34
+
35
+ โŒ **Avoid Comments For**:
36
+ - Explaining obvious code
37
+ - Duplicating what the code already clearly states
38
+ - Commenting out unused code (delete it instead)
39
+ - Line-by-line explanations
@@ -0,0 +1,6 @@
1
+ ---
2
+ description:
3
+ globs:
4
+ alwaysApply: true
5
+ ---
6
+ You can find the path of the adk-python at the root : adk-python/
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2025 Agent Development Kit (ADK) Contributors
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,260 @@
1
+ <div align="center">
2
+ <img src="adk-typescript.jpg" alt="ADK TypeScript Logo" width="100%"/>
3
+
4
+ <p align="center">
5
+ A robust framework for building AI agents with multi-provider LLM support
6
+ </p>
7
+
8
+ <p align="center">
9
+ <a href="https://www.npmjs.com/package/@iqai/adk">
10
+ <img src="https://img.shields.io/npm/v/@iqai/adk" alt="npm version" />
11
+ </a>
12
+ <a href="https://www.npmjs.com/package/@iqai/adk">
13
+ <img src="https://img.shields.io/npm/dm/@iqai/adk" alt="npm downloads" />
14
+ </a>
15
+ <a href="https://github.com/IQAIcom/adk-ts/blob/main/LICENSE">
16
+ <img src="https://img.shields.io/npm/l/@iqai/adk" alt="license" />
17
+ </a>
18
+ <a href="https://github.com/IQAIcom/adk-ts">
19
+ <img src="https://img.shields.io/github/stars/IQAIcom/adk-ts?style=social" alt="github stars" />
20
+ </a>
21
+ </p>
22
+
23
+ <p align="center">
24
+ <a href="https://pontus-devoteam.github.io/adk-typescript/" target="_blank">
25
+ <img src="https://img.shields.io/badge/Docs-View_Documentation-blue?style=for-the-badge&logo=readthedocs" alt="View Documentation" />
26
+ </a>
27
+ </p>
28
+ </div>
29
+
30
+ ## ๐Ÿš€ Features
31
+
32
+ - **๐Ÿค– Multi-provider Support**: Seamlessly switch between OpenAI, Anthropic, or Google LLMs
33
+ - **๐Ÿ› ๏ธ Tool System**: Create and use custom tools with declarative schemas
34
+ - **๐Ÿ”„ Agent Loop**: Complete implementation of the agent reasoning loop with tool execution
35
+ - **๐Ÿ“ก Streaming Support**: Real-time streaming responses from LLMs
36
+ - **๐Ÿ”’ Authentication**: Flexible auth system for secure API access
37
+ - **๐Ÿ’พ Memory Systems**: Persistent memory capabilities for stateful agents
38
+
39
+ ## ๐Ÿ“š Quick Start
40
+
41
+ ### 1. Installation
42
+
43
+ ```bash
44
+ # Using npm
45
+ npm install @iqai/adk
46
+
47
+ # Using yarn
48
+ yarn add @iqai/adk
49
+
50
+ # Using pnpm
51
+ pnpm add @iqai/adk
52
+ ```
53
+
54
+ ### 2. Configure Environment
55
+
56
+ Create a `.env` file in your project root with your API keys:
57
+
58
+ ```env
59
+ OPENAI_API_KEY=your_openai_api_key_here
60
+ ANTHROPIC_API_KEY=your_anthropic_api_key_here
61
+ GOOGLE_API_KEY=your_google_api_key_here
62
+ ```
63
+
64
+ ### 3. Create Your First Agent
65
+
66
+ ```typescript
67
+ import { Agent } from '@iqai/adk';
68
+ import dotenv from 'dotenv';
69
+
70
+ // Load environment variables
71
+ dotenv.config();
72
+
73
+ // Create a basic agent
74
+ const agent = new Agent({
75
+ name: "simple_assistant",
76
+ model: "gemini-2.5-flash-preview-05-20", // Or "gpt-4-turbo" or "claude-3-opus"
77
+ description: "A simple assistant",
78
+ instructions: "You are a helpful assistant. Answer questions concisely."
79
+ });
80
+
81
+ // Run the agent
82
+ async function main() {
83
+ const response = await agent.run({
84
+ messages: [{ role: 'user', content: 'Hello, who are you?' }]
85
+ });
86
+
87
+ console.log(response.content);
88
+ }
89
+
90
+ main().catch(console.error);
91
+ ```
92
+
93
+ ## ๐Ÿ“– Documentation
94
+
95
+ **[View Full Documentation](https://pontus-devoteam.github.io/adk-typescript/)**
96
+
97
+ Our comprehensive documentation includes:
98
+
99
+ - Complete API reference
100
+ - Architecture overview
101
+ - Integration guides
102
+ - Advanced usage examples
103
+ - Provider-specific configurations
104
+
105
+ ## ๐Ÿ—๏ธ Project Status
106
+
107
+ โš ๏ธ **Early Development Stage**
108
+
109
+ This project is currently in early development and should be considered alpha software. While it's functional and can be used in projects, you may encounter:
110
+
111
+ - Breaking changes between versions
112
+ - APIs that may evolve based on user feedback
113
+ - Features that are still being stabilized
114
+
115
+ Current development status:
116
+
117
+ - โœ… Core agent framework
118
+ - โœ… Basic OpenAI implementation
119
+ - โœ… Initial Anthropic integration
120
+ - โœ… Initial Google/Gemini integration
121
+ - โœ… Tool system foundation
122
+ - โœ… Basic memory system
123
+ - ๐Ÿšง Enhanced error handling
124
+ - ๐Ÿšง Improved type safety
125
+ - ๐Ÿšง Extended provider features
126
+ - ๐Ÿšง Advanced memory capabilities
127
+ - โฌœ Comprehensive testing suite
128
+ - โฌœ Performance optimizations
129
+ - โฌœ Advanced streaming features
130
+
131
+ We welcome feedback, bug reports, and contributions! Please check the [issues page](https://github.com/IQAIcom/adk-ts/issues) for known issues or to report new ones.
132
+
133
+ ## ๐Ÿ“š Usage Examples
134
+
135
+ ### Agent with Tools
136
+
137
+ ```typescript
138
+ import { Agent, BaseTool } from '@iqai/adk';
139
+
140
+ // Create a custom calculator tool
141
+ class CalculatorTool extends BaseTool {
142
+ constructor() {
143
+ super({
144
+ name: 'calculator',
145
+ description: 'Perform basic calculations'
146
+ });
147
+ }
148
+
149
+ getDeclaration() {
150
+ return {
151
+ name: this.name,
152
+ description: this.description,
153
+ parameters: {
154
+ type: 'object',
155
+ properties: {
156
+ operation: {
157
+ type: 'string',
158
+ enum: ['add', 'subtract', 'multiply', 'divide']
159
+ },
160
+ a: { type: 'number' },
161
+ b: { type: 'number' }
162
+ },
163
+ required: ['operation', 'a', 'b']
164
+ }
165
+ };
166
+ }
167
+
168
+ async runAsync(args) {
169
+ const { operation, a, b } = args;
170
+
171
+ switch(operation) {
172
+ case 'add': return { result: a + b };
173
+ case 'subtract': return { result: a - b };
174
+ case 'multiply': return { result: a * b };
175
+ case 'divide': return { result: a / b };
176
+ default: throw new Error(`Unknown operation: ${operation}`);
177
+ }
178
+ }
179
+ }
180
+
181
+ // Create an agent with the tool
182
+ const agent = new Agent({
183
+ name: "calculator_assistant",
184
+ model: "gpt-4-turbo",
185
+ instructions: "You can perform calculations. Use the calculator tool when asked about math.",
186
+ tools: [new CalculatorTool()]
187
+ });
188
+
189
+ // Run the agent
190
+ const response = await agent.run({
191
+ messages: [{ role: 'user', content: 'What is 24 * 7?' }]
192
+ });
193
+ ```
194
+
195
+ ### Agent with Memory
196
+
197
+ ```typescript
198
+ import { Agent, PersistentMemoryService } from '@iqai/adk';
199
+ import path from 'path';
200
+
201
+ // Create a memory service
202
+ const memoryService = new PersistentMemoryService({
203
+ storageDir: path.join(__dirname, '.memory'),
204
+ createDir: true
205
+ });
206
+
207
+ // Create an agent with memory
208
+ const agent = new Agent({
209
+ name: "memory_assistant",
210
+ model: "gemini-2.5-flash-preview-05-20",
211
+ instructions: "You have persistent memory. Remember user preferences.",
212
+ memoryService,
213
+ userId: 'user-123'
214
+ });
215
+
216
+ // Run the agent with a session ID for persistence
217
+ const response = await agent.run({
218
+ messages: [{ role: 'user', content: 'Remember that I like blue.' }],
219
+ sessionId: 'persistent-session-1'
220
+ });
221
+ ```
222
+
223
+ ## ๐Ÿงช Example Projects
224
+
225
+ The `examples/` directory contains several example implementations:
226
+
227
+ ```bash
228
+ # Run simple agent example
229
+ npm run example:simple
230
+
231
+ # Run tool usage example
232
+ npm run example:tool
233
+
234
+ # Run memory usage example
235
+ npm run example:memory
236
+
237
+ # Run multi-provider example
238
+ npm run example:multi
239
+
240
+ # Run Anthropic tool example
241
+ npm run example:anthropic
242
+ ```
243
+
244
+ ## ๐Ÿค Contributing
245
+
246
+ We welcome contributions! Please see our [Contributing Guide](CONTRIBUTING.md) for details.
247
+
248
+ 1. Fork the repository
249
+ 2. Create your feature branch (`git checkout -b feature/amazing-feature`)
250
+ 3. Commit your changes (`git commit -m 'Add some amazing feature'`)
251
+ 4. Push to the branch (`git push origin feature/amazing-feature`)
252
+ 5. Open a Pull Request
253
+
254
+ ## ๐Ÿ“„ License
255
+
256
+ This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.
257
+
258
+ ## ๐ŸŒŸ Show your support
259
+
260
+ Give a โญ๏ธ if this project helped you!
package/biome.json ADDED
@@ -0,0 +1,47 @@
1
+ {
2
+ "$schema": "https://biomejs.dev/schemas/1.9.4/schema.json",
3
+ "vcs": {
4
+ "enabled": false,
5
+ "clientKind": "git",
6
+ "useIgnoreFile": false
7
+ },
8
+ "files": {
9
+ "ignoreUnknown": false,
10
+ "ignore": [
11
+ "node_modules/**",
12
+ "coverage/**",
13
+ "dist/**",
14
+ "*.lock",
15
+ "*.log",
16
+ "docs/**"
17
+ ]
18
+ },
19
+ "formatter": {
20
+ "enabled": true,
21
+ "indentStyle": "tab"
22
+ },
23
+ "organizeImports": {
24
+ "enabled": true
25
+ },
26
+ "linter": {
27
+ "enabled": true,
28
+ "rules": {
29
+ "recommended": true,
30
+ "suspicious": {
31
+ "noExplicitAny": "off"
32
+ },
33
+ "complexity": {
34
+ "noForEach": "off",
35
+ "noStaticOnlyClass": "off"
36
+ },
37
+ "style": {
38
+ "noNonNullAssertion": "off"
39
+ }
40
+ }
41
+ },
42
+ "javascript": {
43
+ "formatter": {
44
+ "quoteStyle": "double"
45
+ }
46
+ }
47
+ }