Skip to content

Add application from Elastic Labs for Polkadot Agent Kit #2549

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

Merged
merged 3 commits into from
May 28, 2025

Conversation

chungquantin
Copy link
Contributor

Project Abstract

Polkadot Agent Kit is an open-source library provides developers with a set of tools to build AI Agents that interact autonomously with the Polkadot SDK-based networks.

Grant level

  • Level 1: Up to $10,000, 2 approvals
  • Level 2: Up to $30,000, 3 approvals
  • Level 3: Unlimited, 5 approvals (for >$100k: Web3 Foundation Council approval)

Application Checklist

  • The application template has been copied and aptly renamed (project_name.md).
  • I have read the application guidelines.
  • Payment details have been provided (Polkadot AssetHub (USDC & DOT) address in the application and bank details via email, if applicable).
  • I understand that an agreed upon percentage of each milestone will be paid in vested DOT, to the Polkadot address listed in the application.
  • I am aware that, in order to receive a grant, I (and the entity I represent) have to successfully complete a KYC/KYB check.
  • The software delivered for this grant will be released under an open-source license specified in the application.
  • The initial PR contains only one commit (squash and force-push if needed).
  • The grant will only be announced once the first milestone has been accepted (see the announcement guidelines).
  • I prefer the discussion of this application to take place in a private Element/Matrix channel. My username is: @_______:matrix.org (change the homeserver if you use a different one)

@github-actions github-actions bot added the admin-review This application requires a review from an admin. label Apr 29, 2025
Copy link
Contributor

github-actions bot commented Apr 29, 2025

CLA Assistant Lite bot All contributors have signed the CLA ✍️ ✅

@chungquantin
Copy link
Contributor Author

I have read and hereby sign the Contributor License Agreement.

@chungquantin
Copy link
Contributor Author

recheck

Copy link
Contributor

@keeganquigley keeganquigley left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @chungquantin I need to delve further into your application but in the meantime could you compare your project to the other agent kit application that is currently open and list the similarities/differences?

@chungquantin
Copy link
Contributor Author

chungquantin commented Apr 30, 2025

@keeganquigley Thanks for quick response on the application, our team is aware of the existing agent kit application but there are a lot of differences but these twos:

  • Fist point would be our library has been built since the start of 2025 to cover basic functionalities to manage wallets, connect to chains and transfer with real Telegram bot example.
  • Second point, our application mainly targets at DeFi and cross-chain use cases which are not covered in the other applications which are the main focus of our application. We found XCM / ISMP and cross-chain use cases are extremely hard to learn / integrated into existing DApps.
  • Focus more on distribution and real usage by delivering Agent Kit Playground and examples.
  • In terms of Agentic features, we want to focus more on making the library compatible with different agent toolings such as MCP, Eliza, A2A

Here's a breakdown of the similarities and key differences:

Similarities:

  • Core Goal: Both aim to create a toolkit/library for AI agents to interact with the Polkadot ecosystem.
  • Target Audience: Developers building AI-powered applications on Polkadot.
  • Key Functionality Areas: Wallet management, token transfers, Polkadot network interaction.
  • Technology Stack (Overlapping): Use of Polkadot API, integration with AI agent frameworks like LangChain.

Key Differences and Potential Strengths:

  • Pop Agent Kit CLI - Allows developers to initialize the agent kit starter code base easily.
  • Support multiple LLM models - Consider migrating the codebase to LiteLLM to support more LLM models.
  • Support multiple External Context Provider: MCP & Eliza OS compabitibility - Allows developers to integrate the Polkadot Agent Kit as Eliza OS plugin and easily hosting a MCP Server using the kit.
  • Options to deploy AI agents: Vercel AI SDK Deployment & PHALA TEE Deployment (This will need to be reconsidered in the future).

Potential Ecosystem Integrations:

  • Hydration
  • Apillon
  • PolkaAssembly

Developer onboarding and distribution (additional scope - voluntary):

  • Launch comprehensive documentation, quick-start guides, and interactive demos to lower the barrier to entry for new developers.
  • Utilize OpenGuild as a distribution platform through online/offlines workshop, collaborate with Polkadot’s flagship events to distribute/promote the kit.
  • Introduce open-source bounties at OpenGuild’s meetups to incentivize developers to build agentic applications using the kit, increase mindshare.

@takahser
Copy link
Collaborator

takahser commented May 2, 2025

@chungquantin

Key Differences and Potential Strengths of Your Proposal ("Polkadot Agent Kit"):

What do you mean by "Your Proposal"?

MCP & Eliza OS compabitibility - Allows developers to integrate the Polkadot Agent Kit as Eliza OS plugin and easily hosting a MCP Server using the kit.

Regarding Eliza OS compatibility: Will this depend on the acceptance of the ElizaOS team of your project? In other words, if you opened an PR on their side and it's not merged, would usability and visibility of the integration be impacted by that?

@chungquantin
Copy link
Contributor Author

@chungquantin

Key Differences and Potential Strengths of Your Proposal ("Polkadot Agent Kit"):

What do you mean by "Your Proposal"?

MCP & Eliza OS compabitibility - Allows developers to integrate the Polkadot Agent Kit as Eliza OS plugin and easily hosting a MCP Server using the kit.

Regarding Eliza OS compatibility: Will this depend on the acceptance of the ElizaOS team of your project? In other words, if you opened an PR on their side and it's not merged, would usability and visibility of the integration be impacted by that?

About Eliza OS compability, this does not require the plugin to be merged to Eliza to be used innthe framework. Eliza is designed to be modular, references from https://github.com/elizaos-plugins which are not in Eliza OS main repo.

@chungquantin chungquantin requested a review from keeganquigley May 5, 2025 13:13
keeganquigley
keeganquigley previously approved these changes May 14, 2025
Copy link
Contributor

@keeganquigley keeganquigley left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @chungquantin I'm willing to support it. While waiting for further reviews, please submit KYB verification for Elastic Labs legal entity when you get a chance. Thanks!

@keeganquigley keeganquigley added the ready for review The project is ready to be reviewed by the committee members. label May 14, 2025
Copy link
Member

@semuelle semuelle left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks again for the application, @chungquantin. It looks like you already put quite a bit of thought into it, so I am also happy to support it. I just have some questions for my understanding.

  • Are there safety mechanisms to ensure that the agent doesn't misinterpret details, such as confusing Plancks with DOTs, or when someone uses a comma as a decimal point?
  • I have never used LangChain. Can you explain the steps how to get from a prompt to the correct transaction?
  • I've been trying to understand how one would add more high-level functionality to, say, the Telegram bot. Do I understand correctly that it's enough to define a LangChain "tool" and then register it with the bot? The reason I'm asking is because I think the user demands will be a lot more varied once pallet-revive is live.

@chungquantin
Copy link
Contributor Author

Thanks again for the application, @chungquantin. It looks like you already put quite a bit of thought into it, so I am also happy to support it. I just have some questions for my understanding.

  • Are there safety mechanisms to ensure that the agent doesn't misinterpret details, such as confusing Plancks with DOTs, or when someone uses a comma as a decimal point?
  • I have never used LangChain. Can you explain the steps how to get from a prompt to the correct transaction?
  • I've been trying to understand how one would add more high-level functionality to, say, the Telegram bot. Do I understand correctly that it's enough to define a LangChain "tool" and then register it with the bot? The reason I'm asking is because I think the user demands will be a lot more varied once pallet-revive is live.

Thanks @semuelle, you raised very reasonable questions.

Are there safety mechanisms to ensure that the agent doesn't misinterpret details, such as confusing Plancks with DOTs, or when someone uses a comma as a decimal point?

I have discussed with the team in we confirm that in the inital MVP of the library, we did not handle accepting the DOT unit directly but must be in planck unit, I have created an issue here for my team to tackle: elasticlabs-org/polkadot-agent-kit#43

I have never used LangChain. Can you explain the steps how to get from a prompt to the correct transaction?

We have llm to handle all the NLP parts. In the llm package, you can provide a set of tools (Reference Langchain Tools) to the langchain framework. The tool itself will call the underlying polkadot-api to submit the transaction, and we have another post-submission process to handle the output from the agent. For example, below is the implementation flow for the DOT transferring feature:

  1. Langchain tool is defined with a prompt and a set of tools to trigger based on the provided input from the user's prompt: https://github.com/elasticlabs-org/polkadot-agent-kit/blob/main/packages/llm/src/langchain/transfer.ts#L12
  2. Then the underlying core API is called to submit the transaction to transfer: https://github.com/elasticlabs-org/polkadot-agent-kit/blob/main/packages/core/src/pallets/assets/transferNative.ts#L11

Hence, the integration guide for the library would be as simple as writing a new langchain tool and plug into the Agent Kit library. Right now, the library is still quite simple and we haven't handled the feature that allows external integrations yet, but I can say it is a part of the roadmap. Our plan is to support three standardized approaches here: MCP Servers, A2A protocol, other langchain tools.

I've been trying to understand how one would add more high-level functionality to, say, the Telegram bot. Do I understand correctly that it's enough to define a LangChain "tool" and then register it with the bot? The reason I'm asking is because I think the user demands will be a lot more varied once pallet-revive is live.

The Telegram Bot in this is a library client if I am correct? We will aggregate all the client integrations in one package soon called @polkadot-agent-kit/client that allows user to initialize the client (Discord, Telegram Bot, Twitter Bot) easily. Talking in terms of the pallet-revive, as mentioned above about langchain tools, similar to library like Coinbase Agent Kit or Solana Agent Kit. One can easily fork the library and add new tools to it (or remove tools which are not needed), reusing all the existing core APIs provided in @polkadot-agent-kit/core.

Just a note here what we are proposing is a library and not an agent framework like Eliza, so there are limits to add new features to the existing library, but our approach is to make easy for open contributors to add new feature on top of the library.

semuelle
semuelle previously approved these changes May 16, 2025
Copy link
Member

@semuelle semuelle left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the clarifications, @chungquantin. I am happy to support this project.

Our plan is to support three standardized approaches here: MCP Servers, A2A protocol, other langchain tools.

In that case, perhaps you can reach out to this grantee, to make sure your solutions work together and perhaps publish a user guide/tutorial together?

@chungquantin
Copy link
Contributor Author

Thanks for the clarifications, @chungquantin. I am happy to support this project.

Our plan is to support three standardized approaches here: MCP Servers, A2A protocol, other langchain tools.

In that case, perhaps you can reach out to this grantee, to make sure your solutions work together and perhaps publish a user guide/tutorial together?

Thanks for the suggestion, that's a great idea, we will see if there is a room for collaboration with the Substrate MCP team!

@chungquantin
Copy link
Contributor Author

Thanks @chungquantin I'm willing to support it. While waiting for further reviews, please submit KYB verification for Elastic Labs legal entity when you get a chance. Thanks!

Related to KYB verification, just to clarify that our company is still in the process of establishing the entity (which takes around the next 8 days). Wonder if it is ok to KYC first and I update the KYB later?

@semuelle semuelle requested a review from PieWol May 22, 2025 12:19
@keeganquigley
Copy link
Contributor

Thanks @chungquantin yes feel free to use this KYC verification link instead for now, and then KYB can be updated once the entity is in place.

@chungquantin
Copy link
Contributor Author

Thanks @chungquantin yes feel free to use this KYC verification link instead for now, and then KYB can be updated once the entity is in place.

Thanks @keeganquigley, I have finished the KYC process. Let me know if you need any further information from me or my team. And it would be great if we can have the information on the next step! Thanks again.

@semuelle semuelle requested a review from Noc2 May 23, 2025 11:11
Noc2
Noc2 previously approved these changes May 28, 2025
Copy link
Collaborator

@Noc2 Noc2 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry for the delay here. I'm happy to go ahead with it. Thanks for the application.

@chungquantin chungquantin dismissed stale reviews from Noc2, semuelle, and keeganquigley via 32c8631 May 28, 2025 14:00
@chungquantin
Copy link
Contributor Author

Thanks @Noc2 @semuelle @keeganquigley, I have updated the payment address points to the multisig of Elastic Labs. Hence, making all reviews stale, apologies for the inconvenience but could you help to readdress and let me know the next step?

keeganquigley
keeganquigley previously approved these changes May 28, 2025
Copy link
Contributor

@keeganquigley keeganquigley left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

re-approving

@keeganquigley keeganquigley removed the admin-review This application requires a review from an admin. label May 28, 2025
@keeganquigley
Copy link
Contributor

Thanks @chungquantin once the others re-approve the PR will be merged and then the grant will be active.

@github-actions github-actions bot added the admin-review This application requires a review from an admin. label May 28, 2025
@chungquantin chungquantin requested a review from semuelle May 28, 2025 15:23
@keeganquigley keeganquigley removed the admin-review This application requires a review from an admin. label May 28, 2025
Copy link
Member

@semuelle semuelle left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, LGTM.

@semuelle semuelle merged commit 3a6ab45 into w3f:master May 28, 2025
9 checks passed
Copy link
Contributor

Congratulations and welcome to the Web3 Foundation Grants Program! Please refer to our Milestone Delivery repository for instructions on how to submit milestones and invoices, our FAQ for frequently asked questions and the support section on our website for more ways to find answers to your questions.

Before you start, take a moment to read through our announcement guidelines for all communications related to the grant or make them known to the right person in your organisation. In particular, please don't announce the grant publicly before at least the first milestone of your project has been approved. At that point or shortly before, you can get in touch with us at [email protected] and we'll be happy to collaborate on an announcement about the work you’re doing.

Also, if you haven't yet, consider signing up for the Polkadot Alpha Program. The program offers plenty of resources for people building on Polkadot. Lastly, please remember to let us know in case you run into any delays or deviate from the deliverables in your application. You can either leave a comment here or directly request to amend your application via PR. We wish you luck with your project! 🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ready for review The project is ready to be reviewed by the committee members.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants