- Based on CyberChipped - a Python OpenAI Assistant Framework
- Provides conversational memory, parallel function calling, smart automatic tool choice, and message history using MongoDB
- Utilizes FastAPI and Next.js - the most popular and supported web frameworks
- Quickly add custom functions to your AI agent in a few lines of code
- Solana Agent Actions:
- Transfer tokens from the Agent wallet to other wallets - via Helius
- Swap tokens inside the Agent wallet - via Jupiter and Helius
- Social Integrations:
- X - via the X API (Basic Plan)
- Solana Agent requires no-code changes, only adding simple environment variables, and MongoDB/Redis to work out of the box for a complete AI Agent with real-time chat
- Solana Agent's conversational history is superior to RAG for user interactivity, tool usage, and agent memory/recall/context
- Solana Agent's parallel tool calling and automatic AI tool choice is superior than using any LLM completion API with tool usage from any provider
- Solana Agent is an opinionated framework with one way to do things to keep things simple
- Solana Agent is written in Python the most popular language on GitHub and in the AI field
- Solana Agent replies on X in real-time and only replies when it should
- Clone this repo -
git clone https://github.com/truemagic-coder/solana-agent - Ensure the latest LTS Node is installed with yarn
- Ensure Python 3.12.7 is installed with poetry
- Ensure Docker and Docker Compose are installed
docker-compose up -d- Rename
.env.sampleto.envinsiteandagent - Get and set the PRIVATE_KEY (in base58 string format) in the
sitefolder for.envfile - if you want Solana Actions like sending tokens and swapping with funds from this wallet - Get and set the OPENAI_API_KEY var in the
agentfolder for.envfile - OpenAI API Keys - Get and set the HELIUS_API_KEY and HELIUS_RPC_URL in both folders
.envfiles - Helius - If you want XBot - then setup a X developer account and setup the keys in
agentfolder for.envfile - and uncomment the code inmain.py - Set all the secrets to match between the
.envfiles and make themuuidv4s or other strong keys - Open two terminal windows
Terminal 1:cd site && yarn install && yarn devTerminal 2:cd agent && poetry install && bash ./dev.sh- Open your browser to
http://localhost:3000
- Provision a MongoDB and Redis database
- Get one domains with two sub-domains - one for the
siteand one for theagent - Add the proper env vars on Heroku or Dokku to your apps
- Add your proper remotes in each folder locally (each folder
siteandagentshould be their own repos -git init) - For each folder (
siteandagent) git commit and git push to the main branch - Make sure to ps:scale
workerandschedulerto 1 (web should already be 1)
- Use expressive snake-case names for the functions with expressive param names (if required)
- Functions only take
strparams and must output astr(string) - Functions must be fully sync - you cannot use async libraries or methods - example: using
requestsnothttpx(sync vs async) - Don't make tool outputs (strings) too large as when calling multiple calls in parallel has a size limit (combined)
- Keep in mind the 128k model token input limit when processing data especially from APIs
- OpenAI
gpt-4ois recommended overgpt-4o-minisimply for AI IQ but if cost is a concern then mini may work for your agent usage
Contributions to Solana Agent are welcome! Please feel free to submit a Pull Request.
This project is licensed under the MIT License - see the LICENSE file for details.
