takescake

Introducing Our AI Card Discovery Assistant - Find MTG Cards Through Conversation

2025-10-04

Introducing Our AI Card Discovery Assistant

Today we're excited to launch our Card Discovery Assistant - a conversational AI powered by Gemma that helps you discover Magic: The Gathering cards through natural language conversations.

What Is It?

Instead of rigid search filters, the assistant lets you talk naturally about what you're looking for:

  • "What cards work with +1/+1 counters?"
  • "Show me red card draw options"
  • "Find cards similar to Lightning Bolt"
  • "I need removal in white"

The AI understands your intent, searches our card database, and returns relevant cards with explanations of how they fit your strategy.

How to Access It

Floating Widget (Everywhere)

Look for the 🃏 floating button in the lower-left corner of any page. Click it to open a minimizable chat interface that stays with you as you browse.

Dedicated Page

Visit /assistant for a full-page experience with usage tips and examples.

Navigation Link

Click "🤖 AI Assistant" in the main navigation to jump straight to the assistant.

How It Works

1. Theme-Based Matching

The assistant uses intelligent keyword matching across 10+ common MTG strategies:

  • Counters: +1/+1 counters, proliferate, evolve, adapt
  • Draw: Card draw, card advantage, cantrips
  • Removal: Destroy, exile, damage-based removal
  • Ramp: Mana acceleration, land fetching
  • Tribal: Creature type synergies
  • Graveyard: Recursion, reanimation, flashback
  • Sacrifice: Aristocrats, death triggers
  • Tokens: Token generation, go-wide strategies
  • Lifegain: Life gain triggers and payoffs
  • Storm: Spellslinger, instant/sorcery matters

2. Smart Scoring

Cards are ranked by relevance using a two-tier system:

  • Primary keywords (10 points): Exact matches like "+1/+1 counter"
  • Secondary keywords (2 points): Broader matches like "counter"

This ensures you get cards that actually work with your strategy, not just tangentially related cards.

3. Gemma-Powered Explanations

Once relevant cards are found, Gemma AI:

  • Explains what each card does based on its oracle text
  • Highlights concrete synergies visible in the card text
  • Suggests how to use them together
  • Stays grounded - only discusses abilities actually present in the cards

4. Direct Card Links

Every response includes clickable card links that take you straight to:

  • Full card details
  • All available printings
  • Real-time TCGplayer pricing
  • Purchase options with our affiliate links

Example Conversation

You: "What cards work with +1/+1 counters?"

Assistant: "Great question! Here are some key cards for +1/+1 counter strategies:

Hardened Scales doubles your counters - whenever you'd put one or more +1/+1 counters on a creature, put that many plus one instead.

Winding Constrictor adds even more - when you put counters on artifacts or creatures, you put an additional counter.

Solidarity of Heroes is a powerful instant that can double all counters on target creature for just two mana.

These cards create exponential growth when combined..."

🃏 Hardened Scales View →
🃏 Winding Constrictor View →
🃏 Solidarity of Heroes View →

Best Practices

Be Specific

❌ "Show me good cards"
✅ "Show me red card draw effects"

❌ "Find some creatures"
✅ "Find creatures that work with sacrifice strategies"

Ask About Mechanics

The assistant excels at strategy-based queries:

  • "What cards synergize with Thassa's Oracle?"
  • "Show me aristocrat payoffs"
  • "Find cards that care about instant/sorcery spells"

Follow Up

The assistant provides suggestions after each response. Click them to dive deeper into related strategies or explore alternatives.

Technical Details

How We Ensure Accuracy

After initial testing revealed issues with card relevance and hallucinated synergies, we implemented several improvements:

  1. Precise Keyword Matching: Primary keywords like "+1/+1 counter" score 5x higher than generic terms like "counter"

  2. Strict Grounding: Gemma receives ONLY oracle text (no flavor text, set info, or artist details) and is explicitly instructed to:

    • Base ALL explanations only on oracle text provided
    • NOT invent abilities, costs, or interactions
    • NOT include URLs or links in responses
    • Acknowledge when information is unclear or missing
  3. Oracle Text Only: Each card's context includes ONLY its type line and oracle text - nothing else from the card data

  4. Response Cleaning: Automatically strips any hallucinated URLs, Sources sections, or markdown links from responses

  5. Transparent Limitations: The UI warns users about the assistant's limitations and best use cases

Under the Hood

  • AI Model: Gemma 3 4B via Ollama (temperature: 0.2 for consistency)
  • Card Database: 109,993+ cards from Scryfall
  • Intent Detection: Automatic routing to card discovery vs general search vs deck building
  • Response Time: Typically 2-4 seconds depending on query complexity
  • Context Window: Up to 5 cards with ONLY type line + oracle text per query
  • Grounding: Strict oracle-text-only approach with hallucination prevention
  • Response Cleaning: Automatic removal of URLs, links, and Sources sections

Privacy & Data

  • All processing happens on our servers
  • No conversation history is stored (yet - this is a planned feature)
  • We don't train on your queries
  • Card searches are anonymous

Limitations & Future Plans

Current Limitations

No Semantic Similarity Yet
Queries like "cards similar to Lightning Bolt" use keyword matching, not embeddings. This means we might miss cards with similar effects but different wording.

No Conversation Memory
Each query is independent - the assistant doesn't remember previous questions. If you ask "tell me more about those," it won't know what "those" refers to.

Limited to Text Matching
We analyze oracle text only. Visual similarity (alternate arts) or flavor-based discovery isn't supported.

Coming Soon

Semantic Embeddings (Q4 2025)
We're adding card embeddings to find cards by similarity, not just keywords. "Show me cards like Sol Ring" will find functional equivalents even if they use different wording.

Conversation History (Q4 2025)
The assistant will remember your conversation, allowing natural follow-ups and context-aware suggestions.

Deck Integration (Q1 2026)
"Add to deck" buttons will let you build decks directly from discovery results, with the assistant suggesting cards to fill gaps.

Price-Aware Discovery (Q1 2026)
Queries like "budget alternatives to Mana Drain" will filter by price ranges and suggest cheaper options.

Pricing & Availability

The Card Discovery Assistant is completely free for all users. No account required, no API limits (within reason), no premium tiers.

We make money through:

  • TCGplayer affiliate links when you buy cards
  • Amazon affiliate links on product posts
  • That's it!

Feedback & Improvement

This is our first conversational AI feature, and we're actively improving it based on user feedback.

Help us improve:

  1. Report bad results: If you get irrelevant cards, tell us your query
  2. Share successful queries: What works well helps us understand patterns
  3. Suggest features: What would make this more useful?

Reach out via:

Try It Now

Ready to discover some cards? Here are some starter queries to try:

  1. "What cards work with sacrifice strategies?"
  2. "Show me green ramp cards under $5"
  3. "Find cards that synergize with Thassa's Oracle"
  4. "I need removal in Boros colors"
  5. "What are good lands for a 3-color deck?"

Click the 🃏 floating button in the lower-left corner, or visit /assistant to get started.

Happy discovering! 🎉


Technical Implementation Notes

For developers and curious users:

Architecture

The assistant uses a three-layer approach:

  1. Intent Detection: Natural language query → intent classification (card_discovery, search, deck_build, etc.)
  2. Card Matching: Theme extraction → keyword scoring → relevance ranking
  3. Response Generation: Top cards + oracle text → Gemma synthesis → formatted response with links

API Endpoints

The conversational API lives at /api/conversation and accepts POST requests:

{
  "message": "What cards work with +1/+1 counters?",
  "intent": "card_discovery"  // optional, auto-detected if omitted
}

Response format:

{
  "response": "Gemma-generated explanation...",
  "intent": "card_discovery",
  "cards": [
    {
      "name": "Hardened Scales",
      "url": "/cards/{oracle_id}",
      "type": "Enchantment"
    }
  ],
  "suggestions": [
    "Tell me more about these synergies",
    "What colors work best for this?"
  ]
}

Environment Variables

OLLAMA_CHAT_MODEL=gemma3:4b  # AI model for responses
OLLAMA_HOST=http://127.0.0.1:11434  # Ollama endpoint

Components

  • CardDiscoveryChat.tsx: Main chat interface (floating + full mode)
  • FloatingChatWidget.tsx: Persistent button wrapper
  • /api/conversation/route.ts: Backend logic for all intents

Performance

  • Average query: ~2.5s (1.5s DB search + 1s Gemma generation)
  • Card index: Loaded into memory on first request, cached afterward
  • Gemma temperature: 0.2 (focused, consistent responses)

Last updated: October 4, 2025

Related Posts