Decentralized AI agent marketplace where developers monetize agents and users rented AI services.
Decentralized AI agent marketplace where developers monetize agents and users rent specialized AI services. (98 characters)
Full Description What is Teela? Teela is a decentralized marketplace that solves the critical monetization problem facing AI agent developers today. While thousands of AI agents are being built across finance, health, career, and other domains, their creators have no way to earn revenue from them. Teela changes this by creating a transparent, blockchain-powered platform where agent owners can list their creations and users can discover and rent specialized AI services. The Problem We're Solving
Connect wallet and access the Owner Dashboard Register new agents or import existing ones from Agentverse using API keys (proves ownership and ensures security) Agents are automatically listed in the marketplace by domain (finance, health, career, etc.) Domain-based pricing ensures fair, standardized rates Track real-time performance metrics, session counts, and revenue through Envio-powered dashboards Withdraw earnings anytime directly from smart contracts
For Users:
Browse agents by domain with transparent performance scores from blockchain Connect wallet via RainbowKit integration Select agent and session duration, approve payment (funds lock in escrow) Interact with agents through our chat interface powered by MeTTa reasoning Sessions are tracked with live timers, scores recorded on-chain automatically All payments and performance data are fully transparent and verifiable
Technical Architecture Frontend: React 19 + Vite + TailwindCSS + Wagmi + RainbowKit for beautiful Web3 UX Backend: Python Flask with Teela Orchestrator that uses MeTTa for structured reasoning Blockchain: Ethereum Sepolia testnet with Solidity smart contracts (AgentRegistry, AgentEscrow, AgentScoring) Indexing: Envio HyperIndex with GraphQL API for real-time blockchain data aggregation AI Integration: ASI Alliance stack (Agentverse for discovery, MeTTa for reasoning, ASI:One for chat protocol) Why This Matters The AI agent economy is stuck because creators can't monetize their work. Teela unlocks this by providing:
Monetization: Automatic payments, transparent revenue tracking, instant withdrawals Discovery: Agentverse integration makes agents findable and accessible Intelligence: MeTTa reasoning gives agents real logical capabilities beyond simple LLM responses Performance: Envio's 100x speed advantage makes real-time tracking actually work Trust: Blockchain transparency, on-chain scores, decentralized infrastructure Security: No centralized data storage, API key authentication, wallet-based ownership
Teela is the infrastructure layer the AI agent economy needs to thrive - turning unused agents into revenue-generating services while giving users transparent access to specialized AI capabilities.
Architecture Overview Teela is a full-stack Web3 application that brings together modern frontend frameworks, blockchain infrastructure, and AI agent orchestration. We built it with four main layers that work together to create a marketplace that actually feels fast and responsive - not like your typical sluggish blockchain app. Frontend Layer React 19 + Vite - We went with React 19 because the concurrent features are excellent, and Vite gives us incredibly fast hot module replacement during development. Honestly, after using Vite, going back to Webpack feels painful. Wagmi 2.18.1 + RainbowKit 2.2.9 - This combo handles all our Web3 interactions and it's been fantastic. Wagmi gives us React hooks for reading from and writing to smart contracts with full TypeScript support (catches so many errors at compile time). RainbowKit provides that beautiful wallet connection modal everyone loves - supports MetaMask, WalletConnect, Coinbase Wallet, and more out of the box. TailwindCSS 4.1.16 - Utility-first styling let us move fast. We built responsive agent cards, dashboards, and chat interfaces without writing mountains of custom CSS. Tailwind's just faster for iteration. Clerk - Even though users connect wallets, we still needed proper authentication and session management. Clerk handles this seamlessly and provides that extra security layer. GSAP 3.13.0 + Framer Motion - We wanted the app to feel polished, not janky. GSAP handles the complex timeline animations on our landing page, while Framer Motion powers smooth component transitions and chat message animations. Smart Contract Layer (Solidity + Hardhat) We deployed three core contracts on Ethereum Sepolia testnet: AgentRegistry.sol - Stores agent metadata (name, domain, owner address, Agentverse reference). When owners register agents, this contract emits AgentRegistered events that Envio picks up immediately for indexing. AgentEscrow.sol - Handles all payment logic. When users rent an agent, their funds lock in escrow with a timestamp. We used OpenZeppelin's ReentrancyGuard to prevent reentrancy attacks because security matters. Payments only release after sessions complete and scores are recorded. Owners can call withdrawEarnings() anytime to claim their revenue. AgentScoring.sol - Records performance scores (0-100) after each session. Emits ScoreRecorded events with agentId, score, timestamp, and sessionId. This is the critical data that Envio indexes for our real-time dashboards. Hardhat 2.26.3 - Our development environment of choice. We wrote extensive tests to make sure the escrow logic was bulletproof (money stuff needs to be secure). The deployment scripts automatically verify contracts on Etherscan for transparency. Envio Integration - This Changes Everything Here's where things get interesting. Without Envio, Teela literally wouldn't work at scale. The Problem We Faced: If we queried smart contracts directly via RPC calls every time someone viewed an agent's dashboard, we'd need to:
Call getAgentScores(agentId) to fetch all historical scores Loop through and manually calculate the average Call getSessionCount(agentId) Call getTotalRevenue(agentId) Aggregate all this in the frontend
For a marketplace with 100+ agents, this would mean hundreds of RPC calls taking 5-10 seconds per page load. Completely unusable. Users would leave immediately. How Envio Solved This: We scaffolded our indexer with pnpx envio init and defined our schema in schema.graphql: graphqltype Agent @entity { id: ID! name: String! domain: String! owner: String! totalScore: Int! sessionCount: Int! averageScore: Float! totalRevenue: BigInt! lastUpdated: Int! } Then we wrote event handlers in TypeScript that run automatically whenever our smart contracts emit events: typescriptScoreRecordedEvent.handler(async ({ event, context }) => { const agent = await context.Agent.get(event.params.agentId);
// Real-time aggregation happens here agent.totalScore += event.params.score; agent.sessionCount += 1; agent.averageScore = agent.totalScore / agent.sessionCount; agent.lastUpdated = event.block.timestamp;
await context.Agent.set(agent); }); The Result: Envio's HyperIndex processes events in under 100ms and exposes a clean GraphQL API. Our frontend makes ONE query and gets all aggregated data instantly: graphqlquery GetAgents { agents { id name averageScore sessionCount totalRevenue } } We deployed to Envio's hosted service with one command (envio deploy), and now all our blockchain data is indexed in real-time with zero infrastructure management needed. The performance difference is genuinely game-changing - 100x faster than traditional RPC calls. This is what makes Teela feel like a modern web app instead of a typical blockchain dapp. ASI Alliance Integration - Making Agents Actually Intelligent Agentverse Integration: When owners register agents, they provide their Agentverse API key. We validate ownership by calling Agentverse APIs to confirm they actually control the agent they're trying to list. The agent metadata (including the Agentverse agent address) gets stored on-chain in our AgentRegistry contract. When users rent an agent, our backend retrieves the Agentverse address from the registry and establishes a connection to the actual agent running on Agentverse's infrastructure. This way, agents stay on Agentverse where they're already hosted - we just orchestrate the discovery and payments. MeTTa Reasoning - The Secret Sauce: This is what makes Teela agents genuinely intelligent instead of just fancy chatbots. Instead of forwarding user messages directly to agents as raw prompts, our Teela Orchestrator uses MeTTa (SingularityNET's reasoning engine) to:
Parse user intent into structured knowledge graphs Apply logical inference rules over domain-specific knowledge bases Route requests to agents with enriched, contextualized information Validate agent responses for logical consistency
We integrated the MeTTa Python library into our backend: pythonfrom hyperon import MeTTa
metta = MeTTa()
metta.run("!(load-ascii finance-rules.metta)")
result = metta.run(f"!(reason-about-investment '{user_query}')") MeTTa gives us provable reasoning chains rather than just probabilistic LLM outputs. For domains like finance and health where accuracy really matters, this is critical. Users aren't just getting GPT-style responses - they're getting logically sound reasoning backed by knowledge graphs. ASI:One Chat Protocol: We implemented the ASI:One protocol for human-agent messaging. Instead of building custom WebSocket infrastructure from scratch, ASI:One provides standardized message formatting, identity verification, and session management. Our chat interface speaks ASI:One natively, which makes Teela interoperable with the broader ASI ecosystem. It just works. Backend Layer (Python Flask) Flask - We chose Flask because it's lightweight and perfect for our needs. It handles:
Agent session management and lifecycle Score calculation algorithms MeTTa reasoning orchestration Communication with Agentverse agents
Web3.py - Lets our Python backend interact with smart contracts. When a session ends, the backend signs transactions to submit scores on-chain. Requests - Makes HTTP calls to Agentverse APIs to retrieve agent metadata and establish connections. The backend is intentionally stateless - all persistent data lives either in smart contracts or Envio's indexed database. This makes it horizontally scalable when we need to handle more traffic. Creative Implementation Details
Agentverse provides agent discovery and hosting without us needing to build complex infrastructure MeTTa gives our orchestrator logical reasoning capabilities that make agents actually intelligent, not just LLM wrappers ASI:One standardizes our chat protocol and makes us interoperable with the broader ASI ecosystem
The integration process was smoother than expected - their documentation and example code were genuinely helpful. Development Challenges We Hit Challenge 1: Our Envio event handlers weren't aggregating data correctly at first. Took us a while to realize we were using += on BigInt fields incorrectly in TypeScript. Posted in Envio's Discord and got help debugging in under an hour. Community support was excellent. Challenge 2: RainbowKit wallet connection kept breaking on mobile browsers. After some debugging, we found that Clerk's session management was conflicting with wallet connection state. Fixed it by carefully orchestrating the connection sequence - wallet first, then Clerk authentication. Challenge 3: MeTTa reasoning was initially taking around 2 seconds per query, which made the chat feel slow. We optimized by preloading knowledge graphs on server startup instead of loading them per-request. Now it averages 200ms, which feels snappy. What We're Proud Of
Seamless Web3 integration - Everything from smart contracts to React frontend talks to blockchain smoothly. Users who aren't crypto-native can still use Teela without confusion. Actually fast performance - Envio makes our dapp feel like a Web2 application. No waiting around for blockchain queries. Real AI reasoning - MeTTa integration gives us genuine intelligence, not just another LLM wrapper. The reasoning is structured and provable. Production-quality code - We didn't cut corners. Proper error handling, security considerations, gas optimizations, comprehensive testing.
Teela proves you can build fast, intelligent, user-friendly Web3 applications when you choose the right technology stack. The combination of React + Wagmi + Envio + ASI Alliance + Solidity works remarkably well together. Each piece complements the others.RetryClaude does not have the ability to run the code it generates yet.

