Crypto AI Agent
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

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

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
- Live Demo: https://aishepherd.dev/portfolio/crypto-agent
- Walkthrough Video: https://www.youtube.com/watch?v=dT7XhyRpzNk
- Code Repository: https://github.com/The-AI-Shepherd/Crypto_AI_Agent