Bee Agent Framework

Purple Flea for IBM Bee Agent

IBM's Bee Agent Framework brings enterprise-grade agent orchestration to TypeScript and Python. Purple Flea brings crypto financial infrastructure. Together: production-ready autonomous agents that can trade, transact, and earn.

Get Free API Key → View Docs

About IBM Bee Agent Framework

Bee is IBM's open-source framework for building agentic pipelines. It features a ReAct reasoning loop, multi-step tool use, memory management, and observability — all in a production-grade TypeScript package.

🔄
ReAct Loop
Bee agents reason then act in a loop. Purple Flea's crypto tools plug into this loop as standard Bee DynamicTool instances — no custom adapters needed.
🧠
Memory & State
Bee's built-in memory system lets agents remember previous trade results, wallet states, and casino outcomes across multiple reasoning steps.
🏢
Enterprise Observability
Bee integrates with IBM's enterprise monitoring stack. Every Purple Flea transaction, trade, and payment is logged through Bee's structured event system.

TypeScript Integration Example

Define Purple Flea Bee Tools

import { BeeAgent } from 'bee-agent-framework/agents/bee/agent'; import { DynamicTool, StringToolOutput } from 'bee-agent-framework/tools/base'; import { z } from 'zod'; const PURPLEFLEA_KEY = process.env.PURPLEFLEA_API_KEY!; const BASE = 'https://api.purpleflea.com/v1'; async function pfRequest(path: string, body?: object) { const res = await fetch(`${BASE}${path}`, { method: body ? 'POST' : 'GET', headers: { 'X-API-Key': PURPLEFLEA_KEY, 'Content-Type': 'application/json' }, body: body ? JSON.stringify(body) : undefined }); return res.json(); } // Tool: Get crypto price const getPriceTool = new DynamicTool({ name: "get_crypto_price", description: "Get current price for any cryptocurrency. Pass 'BTC', 'ETH', etc.", inputSchema: z.object({ symbol: z.string().describe("Cryptocurrency symbol e.g. BTC") }), async handler({ symbol }) { const data = await pfRequest(`/trading/price/${symbol}`); return new StringToolOutput( `${symbol}: $${data.price.toLocaleString()} (${data.change_24h > 0 ? '+' : ''}${data.change_24h.toFixed(2)}% 24h)` ); } }); // Tool: Open trade const openTradeTool = new DynamicTool({ name: "open_trade", description: "Open a perpetual futures position on Purple Flea", inputSchema: z.object({ symbol: z.string(), side: z.enum(["long", "short"]), size: z.number().positive().max(100), leverage: z.number().int().min(1).max(10).default(1) }), async handler(params) { const trade = await pfRequest('/trading/open', params); return new StringToolOutput( `Trade opened: ${trade.position_id} | ${params.side} ${params.symbol} ${params.size}x${params.leverage}` ); } });

Create Trading Bee Agent

import { BeeAgent } from 'bee-agent-framework/agents/bee/agent'; import { OpenAIChatLLM } from 'bee-agent-framework/adapters/openai/chat'; import { UnconstrainedMemory } from 'bee-agent-framework/memory/unconstrainedMemory'; const llm = new OpenAIChatLLM({ modelId: 'gpt-4o' }); const agent = new BeeAgent({ llm, memory: new UnconstrainedMemory(), tools: [getPriceTool, openTradeTool, getBalanceTool] }); // Run the agent const response = await agent .run({ prompt: `Check BTC and ETH prices. If BTC is up more than ETH in the last 24h, open a small long on BTC (size 10, leverage 2). If ETH is stronger, go long ETH instead.` }) .observe((emitter) => { // Log every tool call for auditability emitter.on('update', ({ data }) => { console.log(`[${data.type}] ${JSON.stringify(data)}`); }); }); console.log(`Agent result: ${response.result.text}`);

Enterprise Crypto Agents with Bee + Purple Flea

IBM Bee Agent Framework's enterprise observability and Purple Flea's crypto APIs — the production-grade combination for financial agent systems.