Crypto AI Agent

A LangGraph-powered system for routing, analyzing, and responding to crypto queries using structured tools and data pipelines

Continue reading...

Featured Project
portfolio

A simple yet effective lead management tool with AI assistance

May 03, 2025

I built a smart tool for myself, business owners and marketers that automates lead management, making scheduling calls and tracking leads quick and easy.

Project
portfolio

Building a Crypto Price Feed for the Web

May 03, 2025

This is a cryptocurrency tracking tool that displays historical price data over the past 365 days, allowing users to easily view trends through both tabular data and visual charts.

About

This is an AI-powered crypto assistant that uses routing and specialized tools to deliver structured insights from market data, technical analysis, and news.

Overview

An AI-powered crypto assistant that interprets user queries and delivers structured responses using a routed LangGraph architecture, specialized tools, and structured data pipelines.

The system is designed to produce reliable, context-aware outputs while remaining resource-efficient and scalable.


Architecture

System flowchart depicting the end-to-end pipeline of a crypto AI agent, including input handling via Flask, query classification, tool routing (charts, analysis, news, database), and response generation back to the user.

The system follows a structured pipeline:

  • Flask backend handles incoming requests
  • LangGraph agent routes queries based on intent
  • Specialized tools handle data retrieval and analysis
  • Frontend renders results and visualizations

The agent dynamically selects execution paths instead of relying on a single generalized prompt.


 Query Routing

User queries are often unstructured and ambiguous.

A lightweight classification layer determines:

  • Whether the query is crypto-relevant
  • Whether a specific asset is referenced
  • The appropriate category and execution path

This routing ensures each query is processed with the correct tools and prompts, improving both efficiency and response quality.


Tooling & Data Strategy

The system follows a tool-first design, minimizing reliance on raw LLM reasoning.

Market Data

  • Prices are stored locally and updated via scheduled API calls
  • External API usage is minimized (daily updates per asset)
  • Reduces latency, cost, and dependency on real-time calls

Technical Analysis

  • Indicators are precomputed from structured price data
  • The LLM receives clean, formatted inputs instead of raw data
  • Prompts explicitly define how each indicator should be interpreted

News

  • Relevant articles are selected from trusted sources
  • The system prioritizes high-signal, popular content over volume

FAQ Handling

  • Common crypto questions are handled via predefined prompt-based responses
  • Ensures consistent answers for foundational queries

Visualization Layer

  • Charts are generated on the client side using Plotly (JavaScript)
  • Backend passes structured JSON instead of retaining chart objects
  • This reduces memory usage and improves performance

A technical analysis generated by the crypto AI agent based on a bollinger bands chart


Constraints & Optimization

A 512MB RAM constraint was used in production to evaluate system efficiency.

This exposed performance bottlenecks and led to major optimizations:

  • Refactoring of over 2,000 lines of code
  • Removal of unnecessary object retention
  • Consolidation of logic where appropriate
  • Transition to a stateless (one-shot) agent design
  • Migration of chart rendering to the frontend

These changes significantly improved stability and resource usage.


Key Design Decisions

  • Routed agent architecture using LangGraph
  • Tool-first approach instead of LLM-centric logic
  • Structured inputs for deterministic outputs
  • Stateless query processing model
  • Client-side rendering for visualization efficiency

Outcomes

  • Efficient handling of ambiguous, real-world user queries
  • Reduced API usage and operational costs
  • Improved system stability under constrained resources
  • Modular architecture that separates routing, tools, and presentation

Resources


If you haven't seen enough, here's another one for you. I dove into the world of recruitment and found a way to make it faster and fairer! Using cool technology called AI, I created a system that can quickly look through lots of resumes to find the best candidates. This means I save time and help companies make better choices without bias.

Learn More

About

This is an AI-powered crypto assistant that uses routing and specialized tools to deliver structured insights from market data, technical analysis, and news.