Skip to main content
Sherif Cherfa & Sarah Chieng
February 12, 2026
Open in Github
Verifying the validity of your docs is a key part of mantaining good documentation. However, manually auditing docs is tedious and error-prone. This notebook builds an automated docs checker that crawls your documentation site with Browserbase and analyzes each page with Cerebras for quality issues. To get started, you’ll need the following API keys:

Step 1: Environment Setup + API Keys

Install dependencies and configure Cerebras, Browserbase, and Langchain
Set your Cerebras and Browserbase credentials. You can also set these as environment variables.

Step 2: Define Data Models

First, create pydantic models to capture crawl results and detect issues. Concretely, the checker will detect the following categories of issues:
  • Unresolved references: links, anchors, or assets that fail to resolve.
  • Invalid snippets: code or structured blocks that are syntactically invalid or contain obvious placeholders.
  • Source-of-truth mismatches: claims in the docs that do not match an authoritative source (for example, a repository).
  • Cross-page inconsistencies: factual contradictions across different documentation pages.
  • Language errors: clear spelling or grammatical errors.
  • Missing required elements: required context (such as authentication or installation steps) that is absent based on predefined rules.

Step 3: Crawl Documentation with Browserbase

Use a breadth-first search to discover pages, extract content, and detect broken links during the crawl itself.

Step 5: AI Analysis with Cerebras

Next, use Stagehand (for agentic browser automation) powered by Cerebras (fast inference) to analyze content to identify deeper issues: outdated information, unclear writing, missing context, and grammar errors. The analysis uses structured outputs for reliable JSON parsing.

Step 6: Display Results

Finally, let’s write three functions to view and export findings.
  • summarize: Provides high-level statistics across all pages without listing individual issues
  • show_issues: Displays all issues in a structured table, with optional filtering by severity (critical, high, medium, low)
  • export_issues: Combines both views into a readable Markdown report with overall summaries and issue-level details

Step 7: Run the Analysis

As a last step, configure your target docs site and run the full pipeline.
This is a tutorial implementation. For production use, add rate limiting, authentication handling, improved crawl controls, and stricter output validation.