Repository: flare-foundation/flare-ai-kit
What Is It?
The Flare AI Kit is an open-source Python SDK (licensed under Apache 2.0) that enables developers to build verifiable AI agents using secure enclaves powered by Confidential Space and Intel TDX. It integrates seamlessly with the Flare Network and its ecosystem of decentralized applications.
Core Features
- Verifiable Execution: Secure agent runtime in hardware-isolated environments.
- Consensus Engine: Supports collaborative multi-agent logic with consensus learning.
- Agent Framework: Uses
PydanticAI
with pluggable LLM backends (over 200 supported models). - Flare Protocol Integration: Native connections to FTSO, FAssets, FDC, and various dApps.
- Social Engine: Stream and analyze feeds from platforms like X (Twitter), Telegram, and Farcaster.
Architecture Components
- Agent Engine: Defines and executes LLM-based agents using structured Pydantic classes.
- Vector RAG Engine: Uses
PostgreSQL + pgvector
for embedding-based retrieval. - Graph RAG Engine: Graph-based agent memory using
Neo4j
. - Secure Enclave: Confidential Space and vTPM-based isolated agent execution.
- Ecosystem Engine: Hooks into Flare-native services and smart contracts.
- Social Engine: Monitors and responds to real-time events from decentralized social networks.
- Consensus Engine: Coordinates multi-agent workflows using programmable consensus logic.
Getting Started
git clone --recursive https://github.com/flare-foundation/flare-ai-kit.git
cp .env.example .env # Set environment variables for LLM APIs, etc.
uv sync --all-extras # Install dependencies (Python 3.12+ required)
# Run formatting, linting, typing, and tests
uv run ruff format
uv run ruff check --fix
uv run pyright
uv run pytest
# Deploy to Confidential Space (GCP)
chmod +x gcloud-deploy.sh
./gcloud-deploy.sh
Community
- Status: Pre-release alpha – actively developed and subject to change.
- Stars/Forks: 9 stars, 21 forks (as of writing).
- Issues & PRs: 26 open issues, 11 open pull requests. Development is focused on plugins, RAG extensions, and consensus tooling.
- Contributing: Follows conventional commits, strict typing, and full test coverage as per
CONTRIBUTING.md
.
Ideal Use Cases
- Developing LLM-based agents with verifiable, secure execution.
- Creating multi-agent systems with consensus mechanisms for reliability.
- Building apps deeply integrated with the Flare blockchain ecosystem.
- Developing real-time AI analytics on decentralized social media.
The Value Proposition of Flare AI Kit
In an age defined by exponential advances in artificial intelligence and the growing demand for decentralized, trustless systems, the Flare AI Kit emerges as a forward-looking toolset that fuses the power of verifiable AI with the infrastructure of blockchain technology. Developed by the Flare Foundation, this open-source SDK is not simply another AI agent framework—it is a blueprint for building autonomous systems that are accountable, auditable, and resilient in adversarial or untrusted environments. Its value lies in addressing three deeply interrelated challenges of modern AI: trust, integration, and composability.
At the heart of the Flare AI Kit is its capacity for verifiable execution. In conventional AI workflows, trust is often implicit—users rely on providers to operate models faithfully. But Flare enables developers to deploy AI agents within hardware-isolated Confidential Spaces (via Intel TDX), where logic can execute with cryptographic attestation and immunity from tampering. This feature is particularly valuable in regulated or adversarial domains, where provable integrity of AI output is not a luxury but a necessity. Whether in financial automation, legal inference, or critical decision-making, the ability to prove that an agent’s behavior matches its declared design is a foundational advance in trustworthy AI.
Second, the Flare AI Kit delivers real utility by integrating AI agents directly with the Flare blockchain ecosystem. This includes real-time data feeds from the Flare Time Series Oracle (FTSO), synthetic asset protocols (FAssets), and a suite of decentralized applications like Sceptre and SparkDEX. This enables agents not only to read on-chain data but also to interact with decentralized finance, prediction markets, and data aggregation protocols autonomously. In doing so, Flare AI agents can act as oracles, trading bots, consensus validators, or governance participants—blurring the boundary between artificial intelligence and decentralized computation. The result is not just AI that consumes blockchain data, but AI that participates in the blockchain economy.
Furthermore, the Flare AI Kit introduces a multi-agent consensus engine that enables distributed agents to reach collaborative decisions through programmable voting, scoring, or alignment protocols. This feature represents a fundamental shift from the typical single-agent paradigm. By coordinating multiple agents—each potentially running in different secure enclaves—developers can build systems that are more robust, less biased, and capable of resolving complex decisions via collective intelligence. This opens the door to decentralized AI governance, swarm-based coordination, and long-lived autonomous organizations that can evolve beyond the narrow intent of a single developer or controller.
Another dimension of the Kit’s value lies in its modular design. With engines supporting Retrieval-Augmented Generation (RAG) via PostgreSQL and Neo4j, developers can build memory-rich agents that maintain long-term context and structured recall. Integration with social platforms like Twitter, Telegram, and Farcaster gives agents real-world awareness and the ability to respond to dynamic social or market conditions. By combining graph-based reasoning, LLM backends, and verifiable execution, the SDK provides a coherent foundation for developers to experiment with complex agent architectures that are extensible, composable, and secure.
In summary, the value of the Flare AI Kit can be distilled into four pillars: trust, autonomy, composability, and integration. It gives developers the tools to build AI agents that are not only intelligent but also accountable. It connects those agents to a living blockchain ecosystem that enables action, not just analysis. And it allows these components to be composed in novel configurations—agents that govern, cooperate, analyze, transact, and adapt.
In a world where both artificial intelligence and decentralized systems are racing ahead, the Flare AI Kit offers something rare: a principled bridge between the two, with a clear focus on integrity, verifiability, and future-proof autonomy. For developers, entrepreneurs, and institutions seeking to operationalize trustworthy AI in decentralized environments, this SDK is a strategic enabler—an early glimpse into the architecture of tomorrow’s autonomous systems.
How a Trader Can Use a Flare AI Bot
A trader can use the Flare AI Kit to deploy autonomous, verifiable, and decentralized trading bots that interact directly with the Flare ecosystem. These bots offer secure execution, integrate on-chain and off-chain data, and are capable of executing strategies that combine price signals, technical indicators, and social sentiment.
teps to Use a Trade Bot
1. Define the Strategy
The trader encodes the trading logic as a secure agent using PydanticAI
. Example strategies include:
- Trend-following based on FTSO data
- Arbitrage between FAssets and external exchanges
- Technical setups like RSI, MACD, or moving averages
2. Deploy in Confidential Space
The agent is deployed using gcloud-deploy.sh
to a Confidential Space (Intel TDX enclave), ensuring:
- Execution privacy (protecting logic and data)
- Attestation (proving code is unmodified)
3. Integrate with Flare Protocol
The bot interacts directly with Flare ecosystem services:
- FTSO: Access decentralized, real-time asset prices
- FAssets: Trade synthetic assets
- SparkDEX: Submit trades, manage liquidity
4. Monitor Social Signals
Using the Social Engine, bots analyze content from:
- Twitter (X): Trending topics and sentiment
- Telegram: Group signals or influencer calls
- Farcaster: Web3-native community inputs
5. Use Multi-Agent Consensus
A trader can run multiple agents with different models and use the Consensus Engine to decide on:
- Which agent has the highest-confidence trade signal
- How to weigh conflicting opinions between agents
Advantages of Flare AI Trading Bots
1. Verifiable Execution
The bot's logic runs inside a secure enclave. Traders can prove:
- The bot wasn't tampered with
- It executed the exact logic the trader deployed
2. Real-Time On-Chain Data (FTSO)
The bot gets highly reliable and decentralized data from Flare's oracle, eliminating centralized feed risks and manipulation.
3. Full DeFi Automation
Trade execution, asset minting/redeeming, and liquidity provision can be fully automated on-chain using smart contracts.
4. Social-Aware Intelligence
The bot can analyze real-world events and social sentiment, providing an edge beyond pure price action.
5. Strategy Privacy
Logic, indicators, and internal state remain encrypted and protected, even on third-party servers.
6. Modular & Composable
Traders can swap:
- LLM models (GPT-4o, Claude, etc.)
- Data feeds or plugins (market APIs, sentiment modules)
- Execution policies and risk management modules
Example Use Case
RSI + Sentiment Bot:
- Watches RSI from FTSO price feed
- Parses Twitter for bullish sentiment
- Buys if RSI < 30 and sentiment spikes
- Trades on SparkDEX
- Logs decision history for future training