- Built on CyberChipped: A robust Python framework for OpenAI assistants.
- Enhanced Capabilities: Offers conversational memory, parallel function execution, smart tool selection, and message history with MongoDB.
- Frameworks Utilized: Leverages FastAPI and Next.js, two of the most popular web frameworks.
- Customization Made Easy: Quickly integrate custom functions into your AI agent with minimal code.
- Key Actions:
- Transfer tokens from the Agent wallet to other wallets via Helius.
- Swap tokens within the Agent wallet using Jupiter and Helius.
- Social Media Integration:
- Connects to X through the X API (Basic Plan).
- No Code Changes Required: Just add simple environment variables along with MongoDB/Redis for an out-of-the-box AI agent with real-time chat.
- Advanced Conversational History: Outperforms Retrieval-Augmented Generation (RAG) in user interaction, tool usage, and memory/context recall.
- Efficient Tool Usage: Offers parallel tool calling and automatic AI tool selection, surpassing any LLM completion API.
- Simplicity in Design: An opinionated framework with a straightforward approach to functionality.
- Python-Based: Developed in Python, the leading language in AI and GitHub projects.
- Real-Time Responses: Interacts on X in real-time, responding only when necessary.
- Clone the repository:
git clone https://github.com/rizzolib/Solana-AI-agent
- Ensure you have the latest LTS version of Node installed with Yarn.
- Install Python 3.12.7 using Poetry.
- Install Docker and Docker Compose.
- Start the services:
docker-compose up -d
- Rename
.env.sample
to.env
in bothsite
andagent
directories. - Set the
PRIVATE_KEY
(in base58 format) in the.env
file within thesite
folder for Solana actions. - Obtain and set your
OPENAI_API_KEY
in theagent
folder's.env
file. Get OpenAI API Keys. - Set
HELIUS_API_KEY
andHELIUS_RPC_URL
in both.env
files. Learn More About Helius. - For XBot integration, create an X developer account and configure the keys in the
agent
folder's.env
file; uncomment the relevant code inmain.py
. - Ensure all secrets match between the
.env
files, usinguuidv4
or other secure keys. - Open two terminal windows:
- Terminal 1:
cd site && yarn install && yarn dev
- Terminal 2:
cd agent && poetry install && bash ./dev.sh
- Terminal 1:
- Access the application in your browser at
http://localhost:3000
.
- Provision MongoDB and Redis databases.
- Acquire a domain with two subdomains for the
site
andagent
. - Configure the necessary environment variables on Heroku or Dokku.
- Initialize Git repositories for both
site
andagent
folders. - Commit and push changes to the main branch for both folders.
- Scale the worker and scheduler to 1 (the web should already be set to 1).
- Use clear snake-case naming for functions and descriptive parameter names.
- Functions should accept only
str
parameters and return astr
. - Ensure functions are synchronous; avoid async libraries or methods (e.g., use
requests
instead ofhttpx
). - Limit the size of tool outputs (strings) to accommodate multiple parallel calls within size limits.
- Consider the 128k token input limit when processing data, especially from APIs.
- Opt for OpenAI
gpt-4o
for better performance overgpt-4o-mini
, unless cost is a concern.