Native Agno Integration

Purple Flea Tools for Agno Agents

Agno (formerly Phidata) is the fastest Python and TypeScript framework for building production AI agents with built-in memory, knowledge bases, and tool calling. Purple Flea provides the financial infrastructure layer: crypto wallets on 8 chains, 275 perpetual futures markets via Hyperliquid, provably fair casino games, and domain registration — all wired up through a single PurpleFleasToolkit.


Agno: multi-model agents with memory.

Agno (rebranded from Phidata in 2024) is a lightweight, model-agnostic agent framework used in production by thousands of developers. Its key strengths are a clean tool API, first-class memory persistence, and native support for multi-agent teams. Purple Flea slots in as a Toolkit — one import, every financial capability unlocked.

🔧

Toolkit API

Any class extending Toolkit exposes its methods as callable tools. No schema files, no YAML — just typed Python methods with docstrings.

🧠

Built-in Memory

Agents persist user facts, session history, and summaries across turns. Your agent remembers wallet addresses and open positions automatically between calls.

📚

Multi-agent Teams

Spin up specialist subagents (trader, casino player, domain buyer) coordinated by a team leader. Each gets exactly the tools it needs.

Python & TypeScript OpenAI, Anthropic, Gemini, local LLMs SQLite & Postgres memory Streaming responses FastAPI playground Structured outputs

Install in 30 seconds.

Install agno and the purpleflea-agno toolkit package. Set your API key as an environment variable and you are ready to build.

$ pip install purpleflea-agno
$ export PURPLE_FLEA_API_KEY=sk_live_...

Three lines to a financial agent.

Import PurpleFleasToolkit, pass it to Agent(tools=[...]), and your agent immediately has access to wallets, perpetual trading, casino games, and domain registration.

agent.py
import os
from agno.agent import Agent
from agno.models.openai import OpenAIChat
from purpleflea.agno import PurpleFleasToolkit

agent = Agent(
    model=OpenAIChat(id="gpt-4o"),
    tools=[PurpleFleasToolkit(api_key=os.getenv("PURPLE_FLEA_API_KEY"))],
    description="A crypto trading and casino agent",
    instructions=[
        "Always confirm before opening trades",
        "Show position IDs in responses",
        "Never risk more than 5% of balance on a single casino bet",
    ],
)

agent.print_response("Create a wallet and check ETH price")

Full example with memory persistence and portfolio management:

portfolio_agent.py
import os
from agno.agent import Agent
from agno.models.openai import OpenAIChat
from agno.memory.agent import AgentMemory
from agno.storage.agent.sqlite import SqlAgentStorage
from purpleflea.agno import PurpleFleasToolkit

toolkit = PurpleFleasToolkit(
    api_key=os.getenv("PURPLE_FLEA_API_KEY"),
    referral_code="my-agent-ref",    # earn 10-20% on all referred activity
    enable_casino=True,
    enable_trading=True,
    enable_wallet=True,
    enable_domains=True,
    enable_faucet=True,
    enable_escrow=True,
)

agent = Agent(
    model=OpenAIChat(id="gpt-4o"),
    tools=[toolkit],
    memory=AgentMemory(),
    storage=SqlAgentStorage(table_name="portfolio_agent", db_file="agent.db"),
    description="Autonomous crypto portfolio manager",
    instructions=[
        "Remember wallet addresses across sessions using memory.",
        "Track open position IDs and report them in every response.",
        "Apply Kelly Criterion sizing: max 2% per casino bet.",
        "Always verify the on-chain proof hash for casino outcomes.",
        "Report cumulative P&L at the end of each response.",
    ],
    show_tool_calls=True,
    markdown=True,
)

# The agent remembers your wallet and positions between runs
agent.print_response(
    "Check my ETH balance, open a $15 BTC long at 5x leverage, "
    "place a $2 coin flip bet, then summarise the portfolio.",
    stream=True,
)

Works with Agno TypeScript too.

Agno ships a full TypeScript/Node.js SDK. The Purple Flea Agno package exports typed toolkit classes for both runtimes with identical APIs.

$ npm install @purpleflea/agno @agno/core
agent.ts
import { Agent } from '@agno/core';
import { OpenAI } from '@agno/openai';
import { PurpleFleasToolkit } from '@purpleflea/agno';

const agent = new Agent({
  model: new OpenAI({ id: 'gpt-4o' }),
  tools: [new PurpleFleasToolkit({
    apiKey: process.env.PURPLE_FLEA_API_KEY!,
    enableCasino: true,
    enableTrading: true,
    enableWallet: true,
  })],
  description: 'A crypto trading and casino agent',
  instructions: [
    'Always confirm before opening trades',
    'Show position IDs in responses',
  ],
});

await agent.printResponse('Create a wallet and check ETH price');

Every Purple Flea capability, one toolkit.

PurpleFleasToolkit exposes the full Purple Flea API surface as individually invocable tools. Enable or disable categories per agent use-case.

create_wallet get_balance send_crypto swap_tokens open_trade close_trade get_market_price list_positions get_funding_rate casino_flip casino_dice casino_roulette casino_crash register_domain check_domain claim_faucet create_escrow release_escrow get_referral_earnings

Agno Memory + Finance: your agent never forgets a position.

Agno's built-in memory layer automatically persists conversation summaries, user-stated preferences, and extracted facts to SQLite or Postgres. When combined with Purple Flea tools, this means your agent remembers wallet addresses, tracks open position IDs, recalls your risk tolerance, and maintains strategy state — across every session, without any extra code.

📊

Position memory

Open a BTC long in session one. Return three hours later. The agent recalls the position ID, entry price, and unrealised PnL from its persistent memory store without querying the API twice.

💰

Wallet address recall

Create a multi-chain wallet once. From then on the agent addresses it by nickname — "my ETH wallet" — because the address is stored in AgentMemory and retrieved from semantic search.

🎲

Strategy state

Define a Kelly Criterion bankroll rule once. The agent stores it as a user fact and applies it automatically to every subsequent casino bet and leveraged trade.

📄

Audit log

Every tool call, response, and decision is persisted via SqlAgentStorage. Replay any session, audit the agent's reasoning chain, or export the on-chain proof hashes for every casino bet.

memory_demo.py
from agno.agent import Agent
from agno.models.openai import OpenAIChat
from agno.memory.agent import AgentMemory
from agno.memory.db.sqlite import SqliteMemoryDb
from purpleflea.agno import PurpleFleasToolkit
import os

# Persistent memory backed by SQLite — survives process restarts
memory = AgentMemory(
    db=SqliteMemoryDb(table_name="agent_memory", db_file="pf_memory.db"),
    create_user_memories=True,
    update_user_memories_after_run=True,
    create_session_summary=True,
)

agent = Agent(
    model=OpenAIChat(id="gpt-4o"),
    tools=[PurpleFleasToolkit(api_key=os.getenv("PURPLE_FLEA_API_KEY"))],
    memory=memory,
    user_id="agent-001",   # memories are scoped per agent ID
    show_tool_calls=True,
    markdown=True,
)

# Session 1: agent creates wallet, stores address in memory
agent.print_response("Create me an Ethereum wallet and remember its address.")

# Session 2 (next day): agent recalls the address from memory
agent.print_response("What is my Ethereum wallet address? Show the balance.")

Your agent earns on every transaction it refers.

Pass a referral_code to PurpleFleasToolkit and your agent earns a percentage of every fee generated by users it onboards. Stack commissions across casino, trading, wallets, domains, escrow, and faucet.

Product Commission Rate On What Category
Casino 10% All house rake on referred bets Casino
Trading 20% All trading fees on referred positions Trading
Wallets 10% Swap fees on referred wallets Wallet
Domains 15% Registration & renewal fees Domains
Escrow 15% 15% of the 1% escrow fee Escrow

More frameworks and APIs.

Give your Agno agents real financial power.

Register for a free API key. No credit card. No KYC. Start trading, playing, and earning referral commissions in minutes.

Get API Key →