Skip to content
GEO AI
AnalyzerCLIDocumentationSpecificationContact
Documentation

Getting Started

  • Introduction
  • Quick Start
  • Choose Your Package

GEO Specification

  • Overview
  • llms.txt
  • AI Metadata
  • Crawler Rules
  • Structured Signals
  • Scoring
  • Recommendations

Packages

  • GEO AI Core
  • GEO AI Next
  • GEO AI NestJSnew
  • NestJS — Module Setup
  • NestJS — Configuration
  • NestJS — Service API
  • NestJS — Middleware
  • NestJS — Guard
  • NestJS — Interceptor
  • NestJS — Decorators
  • NestJS — Content Provider
  • GEO AI Woo
  • GEO AI Shopify

Analyzer

  • Overview
  • Scoring
  • Recommendations

CLI

  • GEO AI CLI

Integrations

  • Laravelsoon

Reference

  • Configuration
  • API Reference
  • FAQ
DocsPackagesNestjsMiddleware

Middleware

GeoAIMiddleware handles AI crawler detection, llms.txt serving, and optional Link header injection. Applied automatically when you import GeoAIModule.

Responsibilities

  • Serves llms.txt routes (/llms.txt, /llms-full.txt, /.well-known/llms.txt)
  • Detects AI bots and tracks their visits (fire-and-forget, non-blocking)
  • Injects Link header on all responses (when injectLinkHeader: true)

llms.txt routes

These routes are handled by the middleware — not the controller — for performance. They respond before the NestJS pipeline (guards, interceptors, pipes) runs:

RouteContent
GET /llms.txtStandard llms.txt
GET /llms-full.txtFull version with content
GET /.well-known/llms.txtWell-known URI (same as /llms.txt)

All responses include Content-Type: text/plain; charset=utf-8 and Cache-Control: public, max-age={cacheMaxAge}.

Disabling

Set registerMiddleware: false in module options if you need custom handling:

typescript
GeoAIModule.forRoot({
  // ...
  registerMiddleware: false,
})
PreviousNestJS — Service APINextNestJS — Guard

On this page

  • Responsibilities
  • llms.txt routes
  • Disabling
GEO AI

AI Search Optimization

AnalyzerCLIDocumentationSpecificationContactPrivacy Policy

© 2026 GEO AI · Open Source · MIT License