Files
solana-agent-kit/package.json
ARYAN fd15656304 Langgraph (#78)
# Pull Request Description

## Related Issue
Fixes #61

## Changes Made
This PR adds the following changes:
- Added a new example demonstrating LangGraph integration with Solana
Agent Kit
- Implemented a multi-agent system with specialized agents for different
tasks
- Added state management and routing logic using LangGraph's StateGraph
- Integrated Tavily search capabilities for enhanced general-purpose
queries
- Added support for token swaps using Jupiter DEX
- Implemented TypeScript-based project structure with full type safety
- Added comprehensive documentation and architecture diagram

## Implementation Details
- Created a directed workflow using StateGraph with the following
components:
  - Manager Agent: Handles query classification and routing
- General Agent: Processes basic queries with Tavily search integration
  - Transfer/Swap Agent: Handles token transfers and DEX operations
  - Read Agent: Manages blockchain data queries
- Implemented state management using LangGraph annotations for query
classification
- Added environment-based configuration for API keys and RPC endpoints
- Integrated with external dependencies:
  - @langchain/community v0.3.20
  - @langchain/core v0.3.26
  - @langchain/langgraph v0.2.36
  - solana-agent-kit v1.3.0
- Set up TypeScript configuration with ESM support

## Architecture

<img width="801" alt="Screenshot 2024-12-27 at 5 59 26 PM"
src="https://github.com/user-attachments/assets/a90597ac-3bfc-47e1-b1de-5a17a3de106b"
/>


## Transaction executed by agent 
Example transaction: 


## Additional Notes
- The implementation follows a modular architecture as shown in the
architecture diagram
- Supports both read and write operations on the Solana blockchain
- Includes comprehensive error handling and type safety
- Provides flexible configuration through environment variables
- Project structure follows best practices with clear separation of
concerns
- Includes example queries for testing different agent pathways

## Checklist
- [x] I have tested these changes locally
- [x] I have updated the documentation
- [x] I have added a transaction link
- [x] I have added the prompt used to test it
2024-12-28 02:25:28 +05:30

70 lines
2.1 KiB
JSON

{
"name": "solana-agent-kit",
"version": "1.3.0",
"description": "connect any ai agents to solana protocols",
"main": "dist/index.js",
"types": "dist/index.d.ts",
"scripts": {
"build": "tsc",
"docs": "typedoc src --out docs",
"test": "ts-node test/index.ts",
"generate": "ts-node src/utils/keypair.ts",
"lint": "eslint . --ext .ts",
"lint:fix": "eslint . --ext .ts --fix",
"format": "prettier --write \"src/**/*.ts\" \"test/**/*.ts\""
},
"engines": {
"node": ">=23.1.0",
"pnpm": ">=8.0.0"
},
"keywords": [],
"author": "sendaifun",
"license": "Apache-2.0",
"dependencies": {
"@bonfida/spl-name-service": "^3.0.7",
"@coral-xyz/anchor": "0.29",
"@langchain/core": "^0.3.26",
"@langchain/groq": "^0.1.2",
"@langchain/langgraph": "^0.2.34",
"@langchain/openai": "^0.3.13",
"@lightprotocol/compressed-token": "^0.17.1",
"@lightprotocol/stateless.js": "^0.17.1",
"@metaplex-foundation/mpl-core": "^1.1.1",
"@metaplex-foundation/mpl-token-metadata": "^3.3.0",
"@metaplex-foundation/mpl-toolbox": "^0.9.4",
"@metaplex-foundation/umi": "^0.9.2",
"@metaplex-foundation/umi-bundle-defaults": "^0.9.2",
"@metaplex-foundation/umi-web3js-adapters": "^0.9.2",
"@onsol/tldparser": "^0.6.7",
"@orca-so/common-sdk": "0.6.4",
"@orca-so/whirlpools-sdk": "^0.13.12",
"@pythnetwork/price-service-client": "^1.9.0",
"@raydium-io/raydium-sdk-v2": "0.1.95-alpha",
"@solana/spl-token": "^0.4.9",
"@solana/web3.js": "^1.95.4",
"@tiplink/api": "^0.3.1",
"bn.js": "^5.2.1",
"bs58": "^6.0.0",
"chai": "^5.1.2",
"decimal.js": "^10.4.3",
"dotenv": "^16.4.5",
"form-data": "^4.0.1",
"langchain": "^0.3.6",
"openai": "^4.75.0",
"typedoc": "^0.26.11"
},
"devDependencies": {
"@types/bn.js": "^5.1.5",
"@types/chai": "^5.0.1",
"@types/node": "^22.9.0",
"@typescript-eslint/eslint-plugin": "^7.0.0",
"@typescript-eslint/parser": "^7.0.0",
"eslint": "^8.56.0",
"eslint-config-prettier": "^9.1.0",
"eslint-plugin-prettier": "^5.1.3",
"prettier": "^3.2.5",
"ts-node": "^10.9.2",
"typescript": "^5.7.2"
}
}