Skip to content

Refactor: Create Contextual System Prompts for Tool Categories #71

@CocDap

Description

@CocDap

📋 Overview
Currently, the Polkadot Agent Kit uses a single monolithic system prompt that covers all operations. This makes it difficult to maintain, customize, and provide context-specific guidance for different tool categories.

🎯 Objective
Create category-specific system prompts that provide focused guidance for each tool category, improving AI assistant accuracy and maintainability.

✨ Proposed Refactor

  1. Balance Operations
    Tools: check_balance
const BALANCE_SYSTEM_PROMPT = `
BALANCE OPERATIONS:
- Check native token balances across Polkadot ecosystem chains
- Support for Polkadot, Kusama, Westend, Rococo networks
- Automatic chain initialization if needed
- Clear balance reporting with token symbols
`;
  1. Transfer Operations
    Tools: transfer_native, xcm_transfer_native_asset
const TRANSFER_SYSTEM_PROMPT = `
TRANSFER OPERATIONS:
- Native token transfers within the same chain
- Cross-chain transfers using XCM protocol
- Chain name conversion rules for XCM
- Address validation and amount formatting
`;
  1. Staking Operations
    Tools: join_pool, bond_extra, unbond, withdraw_unbonded, claim_rewards
const STAKING_SYSTEM_PROMPT = `
STAKING OPERATIONS:
- Join nomination pools for staking rewards
- Bond additional tokens to existing pools
- Unbond tokens with withdrawal periods
- Withdraw unbonded tokens after cooling period
- Claim accumulated staking rewards
- Automatic pool membership detection
`;
  1. Swap Operations
    Tools: swap_tokens
const SWAP_SYSTEM_PROMPT = `
SWAP OPERATIONS:
- Cross-chain token swapping via Hydration DEX
- DEX-specific swaps within single chains
- Chain name conversion (PascalCase for swaps)
- Token symbol validation
- Slippage tolerance configuration
`;

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions