Skip to content

agentx-protocol/AgentX-Core

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

AgentX-Core

License: MIT Python 3.10+ PyPI version Build Status Coverage Discord

AgentX-Core is the foundational Python framework for building autonomous AI agents that run on decentralized infrastructure, with native Solana integration via the AgentX Protocol.


What is AgentX?

AgentX Protocol enables autonomous AI agents to operate on-chain — owning wallets, executing transactions, and coordinating with other agents in a trustless swarm. AgentX-Core is the Python SDK that makes building these agents as easy as writing a few lines of code.

from agentx import Agent, SolanaRuntime

agent = Agent(
    name="trader-01",
    runtime=SolanaRuntime(rpc_url="https://api.mainnet-beta.solana.com"),
    model="gpt-4o",
)

result = agent.run("Analyze SOL/USDC price action and propose a trade strategy.")
print(result.output)

Features

  • Autonomous decision loop — agents perceive, plan, and act without human-in-the-loop
  • LLM-agnostic — works with OpenAI, Anthropic, Mistral, or local models via Ollama
  • Solana-native — agents can sign transactions, hold SPL tokens, and call on-chain programs
  • Swarm coordination — agents communicate via AgentX's peer-to-peer message bus
  • Tool use — plug in any Python function as an agent tool in one decorator
  • Observability — structured logging, tracing, and a web dashboard

Installation

pip install agentx-core

Or from source:

git clone https://github.com/agentx-protocol/AgentX-Core.git
cd AgentX-Core
pip install -r requirements.txt
pip install -e .

Requirements: Python 3.10+, a Solana RPC endpoint (devnet or mainnet).


Quick Start

1. Create a simple agent

from agentx import Agent
from agentx.tools import web_search, calculator

agent = Agent(
    name="research-agent",
    tools=[web_search, calculator],
    system_prompt="You are a research assistant that finds accurate information.",
)

response = agent.run("What is the current market cap of Solana?")
print(response.output)

2. Run an agent with a decision loop

from agentx import Agent
from agentx.memory import ShortTermMemory

agent = Agent(
    name="task-planner",
    memory=ShortTermMemory(max_tokens=4096),
    max_iterations=10,
)

# Agent will loop until task is complete or max_iterations reached
result = agent.run_until_done("Plan and draft a report on DeFi trends in 2025.")

3. Deploy to Solana

from agentx import Agent
from agentx.runtime import SolanaRuntime

runtime = SolanaRuntime(
    rpc_url="https://api.devnet.solana.com",
    wallet_keypair_path="~/.config/solana/id.json",
)

agent = Agent(name="on-chain-agent", runtime=runtime)
agent.deploy()  # Registers agent on AgentX program
print(f"Agent deployed at: {agent.on_chain_address}")

Project Structure

AgentX-Core/
├── src/
│   └── agentx/
│       ├── __init__.py        # Public API
│       ├── core.py            # Agent class and decision loop
│       ├── utils.py           # Logging, HTTP helpers, retry logic
│       ├── memory.py          # Short/long-term memory backends
│       ├── tools.py           # Built-in tool definitions
│       └── runtime.py         # Solana runtime adapter
├── tests/
│   ├── test_core.py           # Unit tests for Agent class
│   ├── test_utils.py          # Utility function tests
│   └── fixtures/              # Mock data
├── examples/
│   ├── simple_agent.py
│   ├── multi_agent_swarm.py
│   └── solana_trading_agent.py
├── requirements.txt
├── setup.py
├── pyproject.toml
└── README.md

Contributing

We welcome contributions! Please read our Contributing Guide before submitting a PR.

  1. Fork the repo and create your branch: git checkout -b feat/my-feature
  2. Write tests for your changes
  3. Ensure all tests pass: pytest tests/
  4. Lint your code: ruff check src/
  5. Submit a pull request

Code Style

We use ruff for linting and black for formatting. Run before committing:

black src/ tests/
ruff check src/ tests/

Roadmap

  • Core agent decision loop
  • OpenAI / Anthropic LLM backends
  • Solana wallet integration
  • Multi-agent swarm protocol (v0.3)
  • Persistent agent memory on Arweave (v0.4)
  • Agent marketplace / registry (v0.5)

License

MIT License — see LICENSE for details.

Built with ❤️ by the AgentX community.

About

Autonomous AI Agent framework for the Solana ecosystem

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages