-
Notifications
You must be signed in to change notification settings - Fork 5
Add new mastra agents #29
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
dhilanfye34
wants to merge
5
commits into
agentuity:main
Choose a base branch
from
dhilanfye34:add-new-mastra-agents
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
db3be8f
n8n/\agentuity startup scraper workflow example
dhilanfye34 f7445ae
readme and workflow additions
dhilanfye34 a18a133
coderabbit fixes
dhilanfye34 527a8ba
new mastra agents
dhilanfye34 94674f6
Remove Startup_News_Scraper from PR (keep locally)
dhilanfye34 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,36 @@ | ||
| --- | ||
| description: Guidelines for writing Agentuity AI Agents in TypeScript | ||
| globs: "**/src/agents/**/index.ts" | ||
| alwaysApply: true | ||
| --- | ||
|
|
||
| # AI Agent File | ||
|
|
||
| - Prefer using the `agentuity agent create` command to create a new Agent | ||
| - Prefer loading types from the node modules package `@agentuity/sdk` in the node_modules folder | ||
| - The file should export a default function | ||
| - Prefer naming the default function Agent or the name of the Agent based on the context of the Agent description | ||
| - All code should be in Typescript format | ||
| - Use the provided logger from the `AgentContext` interface such as `ctx.logger.info("my message: %s", "hello")` | ||
|
|
||
| ## Example Agent File | ||
|
|
||
| ```typescript | ||
| import type { AgentRequest, AgentResponse, AgentContext } from "@agentuity/sdk"; | ||
|
|
||
| export default async function Agent(req: AgentRequest, resp: AgentResponse, ctx: AgentContext) { | ||
| return resp.json({hello: 'world'}); | ||
| } | ||
| ``` | ||
|
|
||
| ### AgentRequest | ||
|
|
||
| The AgentRequest interface provides a set of helper methods and public variables which can be used for working with data has been passed to the Agent. | ||
|
|
||
| ### AgentResponse | ||
|
|
||
| The AgentResponse interface provides a set of helper methods for responding with different data formats from the Agent. | ||
|
|
||
| ### AgentContext | ||
|
|
||
| The AgentContext has information specific to the incoming Agent request and a set of helper methods for accessing AI services like KeyValue storage and Vector storage. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,9 @@ | ||
| --- | ||
| description: Guidelines for the Agentuity AI Configuration file | ||
| globs: "agentuity.yaml" | ||
| alwaysApply: true | ||
| --- | ||
|
|
||
| # Agentuity Configuration File | ||
|
|
||
| This file is used by Agentuity to configure the AI Agent project. You should NOT suggest edits to this file. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,97 @@ | ||
| --- | ||
| description: Agentuity JavaScript SDK API Reference | ||
| globs: "src/agents/**/*.ts" | ||
| alwaysApply: false | ||
| --- | ||
|
|
||
| # Agentuity JavaScript SDK | ||
|
|
||
| The Agentuity JavaScript SDK provides a powerful framework for building AI agents in JavaScript and TypeScript. This cursor rules file helps you navigate the SDK's core interfaces and methods. | ||
|
|
||
| ## Core Interfaces | ||
|
|
||
| ### AgentHandler | ||
|
|
||
| The main handler function type for an agent: | ||
|
|
||
| ```typescript | ||
| type AgentHandler = ( | ||
| request: AgentRequest, | ||
| response: AgentResponse, | ||
| context: AgentContext | ||
| ) => Promise<AgentResponseType>; | ||
| ``` | ||
|
|
||
| ### AgentRequest | ||
|
|
||
| The `AgentRequest` interface provides methods for accessing request data: | ||
|
|
||
| - `request.trigger`: Gets the trigger type of the request | ||
| - `request.metadata(key, defaultValue)`: Gets metadata associated with the request | ||
| - `request.get(key, defaultValue)`: Gets the metadata value of the request | ||
| - `request.data.contentType`: Gets the content type of the request payload | ||
| - `request.data.json(): Promise<Json>`: Gets the payload as a JSON object | ||
| - `request.data.text(): Promise<string>`: Gets the payload as a string | ||
| - `request.data.buffer(): Promise<ArrayBuffer>`: Gets the payload as a ArrayBuffer | ||
| - `request.data.binary(): Promise<ArrayBuffer>`: Gets the payload as a ArrayBuffer | ||
| - `request.data.object<T>: Promise<T>`: Gets the payload as a typed object | ||
|
|
||
| ### AgentResponse | ||
|
|
||
| The `AgentResponse` interface provides methods for creating responses: | ||
|
|
||
| - `response.json(data, metadata)`: Creates a JSON response | ||
| - `response.text(data, metadata)`: Creates a text response | ||
| - `response.binary(data, metadata)`: Creates a binary response | ||
| - `response.html(data, metadata)`: Creates an HTML response | ||
| - `response.empty(metadata)`: Creates an empty response | ||
| - `response.handoff(agent, args?)`: Redirects to another agent within the same project | ||
|
|
||
| ### AgentContext | ||
|
|
||
| The `AgentContext` interface provides access to various capabilities: | ||
|
|
||
| - `context.logger`: Logging functionality | ||
| - `context.kv`: Key-Value storage | ||
| - `context.vector`: Vector storage | ||
| - `context.getAgent(params)`: Gets a handle to a remote agent | ||
| - `context.tracer`: OpenTelemetry tracing | ||
|
|
||
| ## Storage APIs | ||
|
|
||
| ### Key-Value Storage | ||
|
|
||
| Access through `context.kv`: | ||
|
|
||
| - `context.kv.get(name, key)`: Retrieves a value | ||
| - `context.kv.set(name, key, value, params)`: Stores a value with optional params (KeyValueStorageSetParams) | ||
| - `context.kv.delete(name, key)`: Deletes a value | ||
|
|
||
| ### Vector Storage | ||
|
|
||
| Access through `context.vector`: | ||
|
|
||
| - `context.vector.upsert(name, ...documents)`: Inserts or updates vectors | ||
| - `context.vector.search(name, params)`: Searches for vectors | ||
| - `context.vector.delete(name, ...ids)`: Deletes vectors | ||
|
|
||
| ## Logging | ||
|
|
||
| Access through `context.logger`: | ||
|
|
||
| - `context.logger.debug(message, ...args)`: Logs a debug message | ||
| - `context.logger.info(message, ...args)`: Logs an informational message | ||
| - `context.logger.warn(message, ...args)`: Logs a warning message | ||
| - `context.logger.error(message, ...args)`: Logs an error message | ||
| - `context.logger.child(opts)`: Creates a child logger with additional context | ||
|
|
||
| ## Best Practices | ||
|
|
||
| - Use TypeScript for better type safety and IDE support | ||
| - Import types from `@agentuity/sdk` | ||
| - Use structured error handling with try/catch blocks | ||
| - Leverage the provided logger for consistent logging | ||
| - Use the storage APIs for persisting data | ||
| - Consider agent communication for complex workflows | ||
|
|
||
| For complete documentation, visit: https://agentuity.dev/SDKs/javascript/api-reference |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,12 @@ | ||
| # EditorConfig is awesome: https://EditorConfig.org | ||
|
|
||
| # top-most EditorConfig file | ||
| root = true | ||
|
|
||
| [*] | ||
| indent_style = tab | ||
| indent_size = 2 | ||
| end_of_line = lf | ||
| charset = utf-8 | ||
| trim_trailing_whitespace = false | ||
| insert_final_newline = false |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,39 @@ | ||
| # dependencies (bun install) | ||
| node_modules | ||
|
|
||
| # output | ||
| out | ||
| dist | ||
| *.tgz | ||
|
|
||
| # code coverage | ||
| coverage | ||
| *.lcov | ||
|
|
||
| # logs | ||
| logs | ||
| _.log | ||
| report.[0-9]_.[0-9]_.[0-9]_.[0-9]_.json | ||
|
|
||
| # dotenv environment variable files | ||
| .env | ||
| .env.development.local | ||
| .env.test.local | ||
| .env.production.local | ||
| .env.local | ||
|
|
||
| # caches | ||
| .eslintcache | ||
| .cache | ||
| *.tsbuildinfo | ||
|
|
||
| # IntelliJ based IDEs | ||
| .idea | ||
|
|
||
| # Finder (MacOS) folder config | ||
| .DS_Store | ||
| # Agentuity | ||
| .agentuity | ||
| .agentuity-crash-*.json | ||
| .env.development | ||
| .env.production |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,117 @@ | ||
| # Blog-Publisher Agent (Hierarchical Multi-Agent Example) | ||
|
|
||
| <div align="center"> | ||
| <img src="https://raw.githubusercontent.com/agentuity/cli/refs/heads/main/.github/Agentuity.png" alt="Agentuity" width="100"/> <br/> | ||
| <strong>Build Agents, Not Infrastructure</strong> <br/> | ||
| <br/> | ||
| <a target="_blank" href="https://app.agentuity.com/deploy" alt="Agentuity"> | ||
| <img src="https://app.agentuity.com/img/deploy.svg" /> | ||
| </a> | ||
| <br /> | ||
| </div> | ||
|
|
||
| The **Blog-Publisher** is a hierarchical AI agent built with [Mastra](https://mastra.ai/) and deployed via [Agentuity](https://agentuity.com). It demonstrates a structured multi-agent workflow where a **Copywriter** creates a blog post, and an **Editor** refines it—both coordinated by a **Publisher** agent. | ||
|
|
||
| Each time a user submits a topic, the Publisher: | ||
| 1. Calls the `copywriterTool` → returns a first draft | ||
| 2. Feeds that draft into `editorTool` → returns polished content | ||
| 3. Displays the final Markdown-formatted blog post in the UI | ||
|
|
||
| Inspired by: [Mastra’s Hierarchical Multi-Agent Example](https://mastra.ai/en/examples/agents/hierarchical-multi-agent) | ||
|
|
||
|
|
||
| ## 📋 Prerequisites | ||
|
|
||
| Before you begin, ensure you have the following installed: | ||
|
|
||
| - **Bun**: Version 1.2.4 or higher | ||
|
|
||
| ## 🚀 Getting Started | ||
|
|
||
| ### Authentication | ||
|
|
||
| Before using Agentuity, you need to authenticate: | ||
|
|
||
| ```bash | ||
| agentuity login | ||
| ``` | ||
|
|
||
| This command will open a browser window where you can log in to your Agentuity account. | ||
|
|
||
| ### Creating a New Agent | ||
|
|
||
| To create a new agent in your project: | ||
|
|
||
| ```bash | ||
| agentuity agent new | ||
| ``` | ||
|
|
||
| Follow the interactive prompts to configure your agent. | ||
|
|
||
| ### Development Mode | ||
|
|
||
| Run your project in development mode with: | ||
|
|
||
| ```bash | ||
| agentuity dev | ||
| ``` | ||
|
|
||
| This will start your project and open a new browser window connecting your agent to the Agentuity Console in DevMode, allowing you to test and debug your agent in real-time. | ||
|
|
||
| ## 🌐 Deployment | ||
|
|
||
| When you're ready to deploy your agent to the Agentuity Cloud: | ||
|
|
||
| ```bash | ||
| agentuity deploy | ||
| ``` | ||
|
|
||
| This command will bundle your agent and deploy it to the cloud, making it accessible via the Agentuity platform. | ||
|
|
||
| ## 📚 Project Structure | ||
|
|
||
| ``` | ||
| ├── agents/ # Agent definitions and implementations | ||
| ├── node_modules/ # Dependencies | ||
| ├── package.json # Project dependencies and scripts | ||
| └── agentuity.yaml # Agentuity project configuration | ||
| ``` | ||
|
|
||
| ## 🔧 Configuration | ||
|
|
||
| Your project configuration is stored in `agentuity.yaml`. This file defines your agents, development settings, and deployment configuration. | ||
|
|
||
| ## 🛠️ Advanced Usage | ||
|
|
||
| ### Environment Variables | ||
|
|
||
| You can set environment variables for your project: | ||
|
|
||
| ```bash | ||
| agentuity env set KEY VALUE | ||
| ``` | ||
|
|
||
| ### Secrets Management | ||
|
|
||
| For sensitive information, use secrets: | ||
|
|
||
| ```bash | ||
| agentuity env set --secret KEY VALUE | ||
| ``` | ||
|
|
||
| ## 📖 Documentation | ||
|
|
||
| For comprehensive documentation on the Agentuity JavaScript SDK, visit: | ||
| [https://agentuity.dev/SDKs/javascript](https://agentuity.dev/SDKs/javascript) | ||
|
|
||
| ## 🆘 Troubleshooting | ||
|
|
||
| If you encounter any issues: | ||
|
|
||
| 1. Check the [documentation](https://agentuity.dev/SDKs/javascript) | ||
| 2. Join our [Discord community](https://discord.gg/agentuity) for support | ||
| 3. Contact the Agentuity support team | ||
|
|
||
| ## 📝 License | ||
|
|
||
| This project is licensed under the terms specified in the LICENSE file. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,75 @@ | ||
| # yaml-language-server: $schema=https://raw.githubusercontent.com/agentuity/cli/refs/heads/main/agentuity.schema.json | ||
|
|
||
| # ------------------------------------------------ | ||
| # This file is generated by Agentuity | ||
| # You should check this file into version control | ||
| # ------------------------------------------------ | ||
|
|
||
| # The version semver range required to run this project | ||
| version: '>=0.0.150' | ||
| # The ID of the project which is automatically generated | ||
| project_id: proj_a453b04d4fd6a0d741faea69eb7a2728 | ||
| # The name of the project which is editable | ||
| name: blog-publisher | ||
| # The description of the project which is editable | ||
| description: "" | ||
| # The development configuration for the project | ||
| development: | ||
| # The port to run the development server on which can be overridden by setting the PORT environment variable | ||
| port: 3500 | ||
| watch: | ||
| # Whether to watch for changes and automatically restart the server | ||
| enabled: true | ||
| # Rules for files to watch for changes | ||
| files: | ||
| - src/** | ||
| # The command to run the development server | ||
| command: bun | ||
| # The arguments to pass to the development server | ||
| args: | ||
| - run | ||
| - --silent | ||
| - --env-file=.env | ||
| - --env-file=.env.development | ||
| - .agentuity/index.js | ||
| deployment: | ||
| command: bun | ||
| args: | ||
| - run | ||
| - --no-install | ||
| - --prefer-offline | ||
| - --silent | ||
| - --no-macros | ||
| - --no-global-search-paths | ||
| - --report-uncaught-exception | ||
| - --disable-sigusr1 | ||
| - --disallow-code-generation-from-strings | ||
| - --no-addons | ||
| - --no-deprecation | ||
| - .agentuity/index.js | ||
| # You should tune the resources for the deployment | ||
| resources: | ||
| # The memory requirements | ||
| memory: 350Mi | ||
| # The CPU requirements | ||
| cpu: 500M | ||
| # The disk size requirements | ||
| disk: 250Mi | ||
| # You should not need to change these value | ||
| bundler: | ||
| enabled: true | ||
| identifier: bunjs | ||
| language: javascript | ||
| runtime: bunjs | ||
| agents: | ||
| dir: src/agents | ||
| ignore: | ||
| - node_modules/** | ||
| - dist/** | ||
| - src/** | ||
| # The agents that are part of this project | ||
| agents: | ||
| - # The ID of the Agent which is automatically generated | ||
| id: agent_83708c4e4737e1d9c5991f75f1229261 | ||
| # The name of the Agent which is editable | ||
| name: supervisor | ||
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Remove
src/**from bundler ignore.Ignoring the entire
src/directory will also exclude your agent source files (src/agents). Update to ignore only build artifacts (e.g.,node_modulesanddist) but keepsrc/agentsincluded.Apply this diff:
📝 Committable suggestion
🤖 Prompt for AI Agents