· Marseil Team

Building a Knowledge Base That AI Agents Actually Understand

Learn the 5 principles for structuring documentation that AI agents can parse, understand, and use to answer customer questions accurately.

Most knowledge bases are written for humans, not machines. That’s a problem when you want AI agents to use them.

AI agents don’t “read” documentation the way humans do. They parse text, extract relationships, and retrieve relevant chunks to answer questions. If your docs aren’t structured for this workflow, your AI agent will hallucinate, give incomplete answers, or fail to find information that’s clearly there.

Here’s how to build a knowledge base that AI agents can actually use.

Principle 1: One Concept Per Page

Humans can navigate a 5,000-word “Complete Guide to Billing” that covers invoices, payments, refunds, and subscription changes. AI agents struggle with this.

When a customer asks “How do I get a refund?”, the AI needs to find the refund section. If it’s buried in a massive page, the AI might:

  • Miss it entirely (retrieval failure)
  • Return irrelevant context (precision failure)
  • Hallucinate an answer because it can’t find the right information

The fix: Split large pages into focused, single-topic articles.

Before:

/docs/billing-complete-guide.md
- Invoices
- Payments
- Refunds
- Subscription changes
- Tax calculations

After:

/docs/invoices.md
/docs/payments.md
/docs/refunds.md
/docs/subscription-changes.md
/docs/tax-calculations.md

Each page should answer one question or cover one workflow. If you find yourself using “and” in the title (“Invoices and Payments”), split it.

Principle 2: Front-Load the Answer

Humans read top-to-bottom and can skip to the section they need. AI agents often retrieve the first few paragraphs of a page as context.

If your page starts with three paragraphs of background before getting to the answer, the AI might not retrieve the relevant part.

Before:

# Refund Policy

At Marseil, we believe in customer satisfaction. Our refund policy has evolved
over the years to balance customer needs with business sustainability. We
understand that sometimes things don't work out...

[3 more paragraphs of background]

## How to Request a Refund

To request a refund, go to Settings > Billing > Request Refund...

After:

# Refund Policy

You can request a refund within 30 days of purchase. Go to
**Settings > Billing > Request Refund** and select the invoice you want to
refund. Refunds are processed within 5–7 business days.

## Eligibility

Refunds are available for:
- Annual subscriptions (prorated)
- Monthly subscriptions (full refund if within 30 days)
- One-time purchases (if unused)

Refunds are not available for:
- Usage-based charges already incurred
- Custom development work

The answer is in the first paragraph. The AI can retrieve this page and immediately provide the key information.

Principle 3: Use Structured Formats

AI agents parse structured content more reliably than free-form prose. Use:

Tables for comparisons:

| Plan | Price | Features |
|------|-------|----------|
| Free | $0 | 100 messages/month |
| Pro | $29 | Unlimited messages |
| Team | $99 | Priority support |

Numbered lists for workflows:

1. Go to Settings > Billing
2. Click "Update Payment Method"
3. Enter new card details
4. Click "Save"

Bullet lists for options:

You can contact support via:
- Email: support@marseil.ai (24-hour response)
- Chat: In-app widget (instant)
- Phone: +1-555-0123 (business hours)

Code blocks for technical content:

To authenticate API requests, include your API key in the header:

\`\`\`bash
curl -H "Authorization: Bearer YOUR_API_KEY" \
     https://api.marseil.ai/v1/messages
\`\`\`

Structured content is easier for AI to parse, extract, and present to customers.

Principle 4: Define Terms Explicitly

Humans infer meaning from context. AI agents need explicit definitions.

Before:

# Enterprise Plan

The Enterprise plan includes all Pro features plus SSO, audit logs, and
dedicated support. Contact sales for pricing.

After:

# Enterprise Plan

The Enterprise plan includes:
- **All Pro features**: Unlimited messages, priority support, custom branding
- **SSO (Single Sign-On)**: Authenticate users via your identity provider (Okta, Azure AD, Google Workspace)
- **Audit logs**: Track all user actions with timestamps and IP addresses
- **Dedicated support**: Named account manager and 1-hour response SLA

Pricing is custom based on your team size and requirements. Contact
sales@marseil.ai for a quote.

The second version defines “SSO” and “audit logs” explicitly. The AI doesn’t need to infer what these terms mean.

Principle 5: Include Examples and Edge Cases

AI agents learn from examples. If your docs only cover the happy path, the AI will struggle with edge cases.

Before:

# Changing Your Plan

You can upgrade or downgrade your plan at any time from the billing page.

After:

# Changing Your Plan

You can upgrade or downgrade your plan at any time from **Settings > Billing > Change Plan**.

## Upgrading

When you upgrade, you're charged the prorated difference immediately.
Your new features are available instantly.

**Example:** If you upgrade from Pro ($29/month) to Team ($99/month) on
January 15th, you're charged $35 (the prorated difference for the remaining
16 days of January).

## Downgrading

When you downgrade, the change takes effect at the end of your current
billing period. You keep your current features until then.

**Example:** If you downgrade from Team to Pro on January 15th, you keep
Team features until January 31st. Your February invoice reflects the Pro price.

## Common Questions

**Q: Do I lose my data when I downgrade?**
A: No. Your data is preserved. However, you may lose access to features that
are only available on higher plans (e.g., audit logs on Enterprise).

**Q: Can I downgrade mid-cycle and get a refund?**
A: No. Downgrades take effect at the end of the billing period. If you need
an immediate change, contact support.

The second version covers the happy path, provides concrete examples, and addresses common edge cases.

Testing Your Knowledge Base

Once you’ve restructured your docs, test them with these questions:

  1. Simple lookup: “What’s your refund policy?”
  2. Workflow: “How do I change my payment method?”
  3. Comparison: “What’s the difference between Pro and Team plans?”
  4. Edge case: “What happens if I downgrade mid-cycle?”
  5. Negative: “Do you offer phone support?” (should answer “no” if you don’t)

If your AI agent can answer all five accurately, your knowledge base is well-structured.

Tools for Knowledge Base Management

Several tools can help you build and maintain AI-friendly docs:

  • Notion: Good for collaborative writing, exports to markdown
  • Confluence: Enterprise-grade, good for large teams
  • GitBook: Developer-focused, version control built-in
  • MkDocs: Static site generator, markdown-based
  • Docusaurus: Open-source, good for technical docs

The tool matters less than the structure. Apply the five principles above regardless of which platform you use.

Maintaining Your Knowledge Base

Knowledge bases rot. Products change, features get deprecated, pricing updates. Build a maintenance process:

Weekly:

  • Review support tickets for questions your docs don’t answer
  • Update any docs referenced in escalations

Monthly:

  • Audit docs for accuracy (especially pricing and feature lists)
  • Remove deprecated content (or mark it as archived)
  • Add examples for common edge cases

Quarterly:

  • Reorganize based on customer feedback
  • Test AI agent accuracy on a sample of questions
  • Identify gaps and plan new content

The Payoff

A well-structured knowledge base doesn’t just help AI agents — it helps humans too. Customers find answers faster, support agents spend less time writing responses, and your docs become a competitive advantage.

The investment pays off in two ways:

  1. AI accuracy improves — fewer hallucinations, more complete answers
  2. Human productivity increases — agents spend less time searching for information

Start with your top 10 most-asked questions. Apply these principles. Then expand.


Want to see how your docs perform with an AI agent? Try Marseil free — connect your knowledge base and get an AI agent live in 10 minutes.