Pokédex Deep Research is a research-focused AI that answers complex Pokémon questions by planning, executing, and evaluating steps with tools based on PokéAPI and optional web search.
OPENAI_API_KEY=<openai_api_key>
TAVILY_API_KEY=<tavily_api_key> # optional - enables web search tool
LOGFIRE_API_KEY=<logfire_api_key> # optional - enables observability/logging
docker build -t pokedex-agent . --no-cache
docker run --env-file .env -p 8000:8000 pokedex-agent
Supports rich, open-ended Pokémon queries like:
- “Build a team of all bug-type Pokémon.”
- “What’s an easy Pokémon to train in Pokémon Ruby?”
- “Find a unique Pokémon that lives by the sea.”
- “What Pokémon should I add next to my party?”
The agent uses purpose-built tools with compact, LLM-ready outputs:
-
get_pokemon_profiles
Fetch profile, battle, location, move, and lore data per Pokémon. -
search_pokemon_by_criteria
Advanced multi-field search based on types, stats, roles, resistances, and ecological traits. -
analyse_pokemon_team
Evaluates a team’s coverage, weaknesses, resistances, speed tiers, and role distribution. -
search_pokemon_web
(optional)
Searches trusted Pokémon sites (e.g., Serebii, Bulbapedia, Smogon) using Tavily. Useful for qualitative or lore-based questions.
Each tool returns minimized, structured strings with:
- Reduced verbosity
- Merged or deduplicated fields
- LLM-controllable scopes (e.g., detail of information)
Scraped from PokéAPI and enhanced with:
.parquet
for fast loading and querying withpandas
- LLM-friendly JSON format with reduced verbosity
- Type chart data for weakness/resistance logic
- Tiered numerical values (e.g., stats) for easier filtering
- Enums for stat categories, roles, tags, habitats, etc.
The core research loop is inspired by TogetherAI's Open Deep Research:
- Plan — Break query into parallel subtasks
- Execute — Call tools based on queries
- Evaluate — Determine if collected results are sufficient
- Repeat — Re-plan if needed or summarize response
- Report — Write comprehensive report with results
Tokens are managed by:
- Carefully crafted prompts
- Limiting tool retries
- Usage limits per execute agent call
- Hard max iteration limits
Error handling and agent summaries converts tool failures into clear, actionable messages for the planning agent.
The system uses a combination thinking and general-purpose models to balance reasoning and response time.
.
├── app.py # Chainlit entry point
├── agents/
│ ├── agents.py # Plan-evaluate logic
│ ├── graph.py # Pydantic execution graph
│ ├── models.py # State and schema definitions
│ └── prompts.py # Prompt templates
├── dataset/
│ ├── build_dataset.py # Raw data scraping and processing
│ ├── generate_types.py # Type generation for Pokémon info
│ ├── type_chart.py # Type chart generation
│ └── utils.py
├── resources/
│ ├── enums.py # Tool input enums
│ ├── pokemon.json # Raw PokéAPI data
│ ├── pokemon.parquet # LLM-ready Pokémon data
│ └── type_chart.json # Pokémon type chart
├── tools/
│ ├── analyse_pokemon_team.py
│ ├── get_pokemon_profiles.py
│ ├── search_pokemon_by_criteria.py
│ └── search_pokemon_web.py
└── pyproject.toml