Your B2B SaaS brand just disappeared from ChatGPT’s answer. Not the first page of Google, that’s holding steady. But the AI-generated summary a prospect sees when they ask “best contract management tool for mid-market legal teams” no longer mentions you. Without agentic routing, a category-page description cannibalised your spot. Your AI visibility sits at 0%.
This isn’t a fluke. AI overviews now appear in 83% of search queries where they exist, and the citations inside those answers determine which brand gets the click. Generating enough content to compete across ChatGPT, Perplexity, Gemini, and Claude is expensive when you run every prompt through a frontier model. But skimp on quality and you’ll never earn a citation. The fix isn’t “write more” or “prompt better”, it’s agentic routing: systematically sending each content task to the model that does it best at the lowest cost.
This recipe pairs Fable 5, a reasoning-first model that builds logical arguments and competitive analysis, with GLM 5.2, an open model that handles high-volume generation at a fraction of the cost. When you wire them together inside a routing harness, you get citation-worthy answer-first content at a cost structure that scales to thousands of AI search queries per month.
In the next 2,000+ words, you’ll build that routing layer step-by-step. By the end, you’ll have a working system that automatically classifies tasks, dispatches them to the right model, and validates the output, all while tracking impact on AI search visibility.
Prerequisites
Before you start, gather:
- Fable 5 API access - Obtain an API key from Fable’s developer console (sign up at fable.ai). Model ID:
fable-5-reasoning. - GLM 5.2 deployment - The open model runs on Hugging Face Inference Endpoints or your own GPU cluster. Use the official GLM 5.2 weights on Hugging Face. Ensure throughput of at least 50 tokens/second to handle volume.
- Orchestration environment - A Python runtime with the LangChain library (v0.2.0+) and access to both model APIs.
- SearchFit account - You’ll need an active subscription to track AI citations and measure the impact of routed content. Sign up for a trial at searchfit.ai.
- Content pipeline - An existing content operation that can ingest AI-generated drafts, even if currently human-written. We’ll retrofit it.
- Understanding of AEO fundamentals - You know that AI answer engines extract and cite structured, answer-first content. If not, read that guide first; it explains why the format matters.
Pro Tip: If your content volume is under 50 pieces/month, you can start with a single model. The routing payoff kicks in above that threshold. Use SearchFit’s AI search tracking to confirm you have enough target queries to justify the setup.
Step 1: Audit Your AI Visibility and Content Gaps
Routing without a target list is spraying tokens into the void. First, you need a precise inventory of the queries you’re losing, and the content types that can win them back.
- Open your SearchFit dashboard and navigate to the AI answer engine monitoring view.
- Filter by answer engine: ChatGPT, Perplexity, Gemini, Claude. For each, export the “Top 100 queries where you rank 0” report.
- Flag two categories:
- Defensive queries: Your brand should be cited because you own the category, but a competitor or generic source appears instead. Example: “best ecommerce platform for furniture” when you sell that.
- Opportunity queries: High-value long-tail questions where you could earn an answer-space citation with a single authoritative page. Example: “how to calculate ecommerce LTV with subscription revenue.”
- Prioritize by search volume and commercial intent. Tools like Semrush or Ahrefs can layer organic volume data on top of AI query lists.
Now you have a content brief list. Each brief requires a different level of cognitive effort: a deep competitive comparison needs heavy reasoning; a templated FAQ for a product category does not.
Step 2: Classify Content Tasks into Reasoning-Heavy vs. Volume
This is where the routing logic starts. You’ll score every content brief on a 0-10 “reasoning intensity” scale. Build the classification in a spreadsheet or a simple JSON object you’ll feed to the harness.
Reasoning-heavy tasks (score 7-10):
- Category comparison pages (“X vs. Y”)
- Competitive displacement queries where you need to unpack why the current citation is wrong
- Net-new concept definition (e.g., “what is geo in ai search”)
- Data-driven pieces that require synthesizing multiple sources
- Agentic content pipeline orchestration strategy documents
Volume tasks (score 0-6):
- Product description expansions (hundreds of SKUs)
- FAQ sections for subcategory pages
- Templated how-to guides with predefined steps
- Simple definition pages (“What is X?”)
- Bulk AEO workflow reproductions across related queries
Warning: Don’t guess. Run both models on five test tasks and check the output. If GLM 5.2’s answer is factually identical to Fable 5’s but 10x cheaper, it’s a volume task. If Fable 5’s answer introduces a stronger logical structure or quote-worthy insight that GLM misses, it’s reasoning-heavy.
This classification is the core of agentic routing. The better you nail it, the higher your cost savings and citation rate.
Step 3: Set Up the Agentic Routing Harness
You’re not building a monolithic LLM call; you’re building a control loop that decides, executes, and checks. I’ll outline a Python harness using LangChain because it handles model abstraction, but you can swap in any orchestration layer.
3.1 Install dependencies
pip install langchain langchain-community python-dotenv huggingface-hub3.2 Define model interfaces
Create a models.py:
from langchain.llms import Anthropic # For Fable 5 (Anthropic-compatible API)
from langchain.llms import HuggingFaceHub # For GLM 5.2
import os
def get_fable5():
return Anthropic(
anthropic_api_key=os.getenv("FABLE_API_KEY"),
model="fable-5-reasoning",
temperature=0.7,
max_tokens_to_sample=2048,
)
def get_glm5_2():
return HuggingFaceHub(
repo_id="THUDM/glm-5.2",
huggingfacehub_api_token=os.getenv("HF_TOKEN"),
model_kwargs={"temperature": 0.3, "max_length": 4096},
)Note: Fable 5 exposes an Anthropic-compatible API; adjust if using a different provider. For GLM 5.2, you can also use a self-hosted endpoint for lower latency.
3.3 Build the router class
Create router.py:
class ContentRouter:
def __init__(self, fable, glm, classifier):
self.fable = fable
self.glm = glm
self.classifier = classifier # A simple TF-IDF + logistic regression or a rules-based scorer
def route(self, task: dict) -> str:
score = self.classifier.reasoning_score(task)
if score >= 7:
return self.fable.generate(task["prompt"])
else:
return self.glm.generate(task["prompt"])We’ll flesh out the classifier in Step 6. For now, wire everything into a main.py that loads tasks from a queue (Redis, a CSV, or your CMS).
For a deeper dive into building that agent loop, including retry logic and verification, see SearchFit’s agent loop architecture.
Step 4: Configure Fable 5 for Reasoning Tasks
Fable 5 shines when you give it a structured brief with explicit constraints. The prompt template below is battle-tested for AEO content.
You are an expert analyst creating a page optimized for AI answer engines (ChatGPT, Perplexity, Gemini, Claude). Your output will be scraped by these engines; structure it for extraction.
Task: {task_description}
Target query: {query}
## Instructions
1. Start with a single-sentence answer that directly addresses the query. Place it in `<answer>` tags.
2. Expand with a 200-word logical argument that supports the answer, citing 2-3 credible external sources where possible.
3. Add a structured comparison table if the query implies a comparison.
4. End with a practical next-step for the reader.
5. Use H2 and H3 headers appropriately.
6. Bold key terms on first mention.
## Output format
Return raw markdown, no conversational prelude.Pro Tip: Fable 5’s pricing is roughly $15 per million input tokens and $60 per million output tokens. But on reasoning-heavy tasks, you’ll often get a citation in 2-3 iterations. That’s $0.12-$0.18 per piece, acceptable for high-stakes defensive queries.
To learn how models like Fable 5 and GPT-5 stack up for content generation, check the 2026 AI model landscape comparison. It helps you decide when to use Fable 5 instead of a general-purpose frontier model.
Step 5: Configure GLM 5.2 for Volume Tasks
GLM 5.2 is an open model optimized for inference speed, not deep reasoning. It writes grammatically correct, factually safe (if bland) content ideal for templated pages.
Why GLM 5.2?
- Cost: On Hugging Face Inference Endpoints, it costs ~$0.0002 per 1k tokens, roughly 100x cheaper than Fable 5 for output.
- Throughput: Handles 50+ tokens/second on an A10G, enabling 300+ pages per day on a single endpoint.
- Controllability: Low temperature (0.1-0.3) keeps output deterministic for bulk generation.
- Format adherence: It reliably follows a markdown template when you provide one.
GLM 5.2 Prompt Template
You are a technical writer creating a product FAQ page. Write exactly according to the template below. Do not deviate.
## Product: {product_name}
## Category: {category}
### Key Features
- Bullet list of 5 features from the provided inventory.
### Frequently Asked Questions
**Q: {question_1}**
A: {template_answer_1}
**Q: {question_2}**
...
## Input data
{json_input}Feed it a JSON blob with pre-researched facts; GLM just assembles them. Never ask it to generate novel claims.
Warning: GLM 5.2 can hallucinate when given open-ended prompts. Always validate its output with a fact-checking step (Step 7). For high-volume content, even a 2% error rate multiplies fast.
Many teams have cut content generation costs by over 60% using this model split. The exact savings depend on your mix; this agentic routing cost-cutting playbook walks through a real implementation.
Step 6: Build the Classification Logic
You can’t route tasks without a reliable classifier. Start simple, then refine.
6.1 Heuristic scorer (rules-based)
Build a scoring function that considers:
- Competitor overlap: If the target query’s top 3 AI citations mention 3+ competitor names, score +2.
- Novelty: If the query is absent from your existing content library (0 matching pages), score +1.
- Complexity: If the SERP contains comparison tables or listicles, score +1.
- Value: If the query drives >5% of total AI-driven site visits (from SearchFit data), score +1.
A score ≥3 maps to reasoning intensity 7+, routed to Fable 5.
6.2 ML classifier (if you have >1k labeled tasks)
Train a simple logistic regression on TF-IDF vectors of task descriptions, labeled with the optimal model from A/B tests. Deploy it as a microservice that returns a score.
Step 7: Validate Output for Citation Quality
Routed content must meet a minimum bar, or AI engines will ignore it. Build a validation step that checks every piece before publishing.
Validation checklist
- Answer presence: Does the output contain a
<answer>-tagged or H2-heading answer in the first 50 words? If not, reject and retry. - Factual consistency: For volume content, run a diff against the source JSON. If more than 5% of claims aren’t in the source, flag for human review.
- Citation-worthiness: Use a second LLM call (e.g., a cheap DistilBERT classifier) to estimate whether the content follows an answer-first format. Train it on a sample of 200 pages that earned AI citations vs. those that didn’t.
- Brand mention: Does the content include your brand name in a natural sentence? (Avoid keyword stuffing.)
A/B test with SearchFit
Publish 10 pieces via the routed pipeline and 10 control pieces (all through a single model or human-written). Over 30 days, monitor AI citation tracking in SearchFit:
- Did any new citations appear for the target queries?
- How does the citation rate compare between groups?
- What’s the cost per new citation?
Pro Tip: The first 2 weeks often show no movement. AI engines re-index content on their own schedule. Keep content live for at least 30 days before cutting.
For a detailed framework on building that validation loop, see the architecture of an AEO agent team.
Step 8: Monitor Cost and Scale
Routing only makes sense if it saves money without sacrificing citations. Measure everything.
Key metrics
- Cost per 1,000 words: Fable 5 ~$5.80; GLM 5.2 ~$0.06. Track the weighted average based on your task mix.
- Tokens consumed per model per day: Set alerts if GLM usage spikes 300% unexpectedly (possible misclassification).
- Citation rate: The percentage of routed pages that earn at least one AI citation within 90 days. Compare to your pre-routing baseline.
- Time to citation: How many days between publish and first citation. Models with stronger reasoning may earn citations faster because they produce more quotable arguments.
Use SearchFit’s AI search visibility tracking tools to create a dashboard. The platform captures brand mentions, share of voice, and citation trends across all major answer engines, so you can tie routing decisions directly to visibility gains.
According to a recent study on enterprise model routing, companies that implemented a simple two-model router saw 50-70% cost reduction in the first quarter, while content quality scores remained within 5% of the all-frontier baseline. Your mileage will vary, start with low-risk volume tasks and gradually migrate more complex ones.
Step 9: Continuously Optimize Routing Rules
Routing is not set-and-forget. Models evolve, content needs change, and AI answer engines alter extraction patterns.
Quarterly audit
Every 90 days:
- Re-score your task library. A task that was reasoning-heavy last quarter may now be well-served by a fine-tuned open model.
- Review model pricing. If GLM 5.2’s inference cost drops or Fable introduces a cheaper tier, rebalance.
- Check SearchFit’s citation data. If GLM-generated pages are suddenly earning citations at the same rate as Fable-generated ones for certain queries, adjust the classification thresholds.
Add a third model if needed
For mid-range reasoning tasks, you might slot in a model like Claude 3.5 Sonnet or GPT-4o-mini. The router can expand to three tiers: high-reasoning (Fable 5), mid-reasoning (Sonnet), high-volume (GLM 5.2). The same principles apply; you just update the score ranges.
Warning: Every additional model adds latency and complexity. Only expand when your task volume exceeds 5,000 pieces per month and you have statistically significant data to define the new tier.
The SearchFit agent loop follows this continual refinement pattern: plan → act → observe → adjust. Your routing harness should do the same.
Summary and Key Takeaways
Agentic routing with Fable 5 and GLM 5.2 gives you a production-ready system for AEO content at scale. You’re no longer paying reasoning-model prices for templated FAQs or gambling brand visibility on a one-size-fits-all prompt.
Here’s what you now have:
- A task classifier that separates content briefs into reasoning-heavy and high-volume buckets.
- Model configurations tuned for each, Fable 5 with a structured AEO prompt, GLM 5.2 with a data-insertion template.
- A routing harness that automatically dispatches, validates, and logs every piece.
- Cost visibility down to the penny per citation, tracked inside SearchFit.
Next step: Run a pilot with 50 tasks from your audit. Compare the cost and citation rate against your current method. If it pans out, increase volume until you hit the throughput limits of your GLM endpoint, then scale horizontally.
You can begin building your own routing agent inside Claude with this AEO workflow guide. Or, if you’d rather plug into a ready-made loop that does all this out of the box, SearchFit monitors your AI visibility, prioritizes content gaps, and generates citation-optimized pages using a similar multi-model router. No more disappearing from ChatGPT.