PHPackages                             schooltry/ai-documentation-generator - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. schooltry/ai-documentation-generator

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

schooltry/ai-documentation-generator
====================================

AI-powered documentation generator for Laravel applications with multi-provider support

052PHP

Since Jan 12Pushed 3mo agoCompare

[ Source](https://github.com/saidabdul80/laravel-ai-docs-generator)[ Packagist](https://packagist.org/packages/schooltry/ai-documentation-generator)[ RSS](/packages/schooltry-ai-documentation-generator/feed)WikiDiscussions main Synced 1mo ago

READMEChangelogDependenciesVersions (1)Used By (0)

AI Documentation Generator
==========================

[](#ai-documentation-generator)

A comprehensive Laravel package for generating end-user documentation from Vue.js frontend applications using AI. Supports multiple AI providers including Ollama, OpenAI, Claude, and Gemini.

Features
--------

[](#features)

- 🤖 **Multi-Provider Support**: Works with Ollama, OpenAI, Claude, Gemini, and SchoolTry AI Service
- 📝 **Automatic Documentation**: Generates comprehensive user guides from Vue components
- 🧭 **Navigation-Aware**: Analyzes navigation structure for accurate user instructions
- 🔗 **Route Links**: Automatically includes clickable route links in documentation
- 🎯 **Context-Rich**: Uses layout files and navigation components for better context
- 📊 **Vector Database**: Build searchable vector databases from generated docs
- ☁️ **Centralized AI**: Use SchoolTry AI Service for consistent documentation generation
- ⚙️ **Highly Configurable**: Extensive configuration options for customization

Requirements
------------

[](#requirements)

- PHP 8.1, 8.2, or 8.3
- Laravel 10.x, 11.x, or 12.x
- Composer

Installation
------------

[](#installation)

### 1. Install via Composer

[](#1-install-via-composer)

```
composer require laravel/ai-documentation-generator
```

### 2. Publish Configuration

[](#2-publish-configuration)

```
php artisan vendor:publish --tag=ai-docs-config
```

This will create `config/ai-docs.php` in your application.

### 3. Configure Your AI Provider

[](#3-configure-your-ai-provider)

Edit `config/ai-docs.php` or set environment variables:

#### For Ollama (Local)

[](#for-ollama-local)

```
AI_DOCS_PROVIDER=ollama
AI_DOCS_OLLAMA_URL=http://localhost:11434
AI_DOCS_OLLAMA_LIGHT_MODEL=qwen2.5:3b-instruct
AI_DOCS_OLLAMA_STANDARD_MODEL=qwen2.5:7b-instruct
AI_DOCS_OLLAMA_HEAVY_MODEL=qwen2.5:14b
```

#### For OpenAI

[](#for-openai)

```
AI_DOCS_PROVIDER=openai
AI_DOCS_OPENAI_KEY=your-api-key-here
AI_DOCS_OPENAI_LIGHT_MODEL=gpt-3.5-turbo
AI_DOCS_OPENAI_STANDARD_MODEL=gpt-4
AI_DOCS_OPENAI_HEAVY_MODEL=gpt-4-turbo
```

#### For Claude

[](#for-claude)

```
AI_DOCS_PROVIDER=claude
AI_DOCS_CLAUDE_KEY=your-api-key-here
AI_DOCS_CLAUDE_LIGHT_MODEL=claude-3-haiku-20240307
AI_DOCS_CLAUDE_STANDARD_MODEL=claude-3-sonnet-20240229
AI_DOCS_CLAUDE_HEAVY_MODEL=claude-3-opus-20240229
```

#### For Gemini

[](#for-gemini)

```
AI_DOCS_PROVIDER=gemini
AI_DOCS_GEMINI_KEY=your-api-key-here
AI_DOCS_GEMINI_LIGHT_MODEL=gemini-1.5-flash
AI_DOCS_GEMINI_STANDARD_MODEL=gemini-1.5-pro
AI_DOCS_GEMINI_HEAVY_MODEL=gemini-2.0-flash
```

#### For SchoolTry AI Service (Recommended)

[](#for-schooltry-ai-service-recommended)

```
AI_DOCS_PROVIDER=schooltry
AI_DOCS_SCHOOLTRY_URL=http://localhost:8000/api/docs
AI_DOCS_SCHOOLTRY_KEY=your-api-key-here  # Optional
AI_DOCS_SCHOOLTRY_LIGHT_MODEL=documentation
AI_DOCS_SCHOOLTRY_STANDARD_MODEL=documentation
AI_DOCS_SCHOOLTRY_HEAVY_MODEL=documentation
```

**Benefits of SchoolTry AI Service:**

- Centralized AI service for consistent documentation
- Dedicated DocumentationGeneratorAgent optimized for user guides
- No external API costs (uses your own infrastructure)
- Customizable prompts and behavior
- Integrated with your SchoolTry ecosystem

Usage
-----

[](#usage)

### Generate Documentation

[](#generate-documentation)

Generate documentation for all routes in your application:

```
php artisan ai-docs:generate
```

#### Options

[](#options)

- `--routes=path/to/router.js` - Specify custom router file path
- `--max-depth=5` - Maximum depth for Vue component crawling
- `--refresh-navigation` - Refresh navigation analysis cache
- `--test-single=/path` - Test documentation generation for a single route
- `--concurrency=1` - Number of concurrent chunk requests
- `--force` - Regenerate docs even if they already exist

#### Examples

[](#examples)

```
# Generate docs with custom router file
php artisan ai-docs:generate --routes=resources/js/router/index.js

# Test a single route
php artisan ai-docs:generate --test-single=/admin/dashboard

# Force regeneration of all docs
php artisan ai-docs:generate --force

# Refresh navigation analysis
php artisan ai-docs:generate --refresh-navigation
```

### Build Vector Database

[](#build-vector-database)

After generating documentation, build a vector database for semantic search:

```
php artisan ai-docs:build-vector-db
```

#### Options

[](#options-1)

- `--dir=path/to/docs` - Directory containing markdown docs
- `--force` - Force rebuild of vector database
- `--limit=10` - Limit number of files to process
- `--upload` - Upload to AI service after building
- `--no-upload` - Skip upload even if enabled in config

### Upload to AI Service

[](#upload-to-ai-service)

Upload the built vector database to your AI service:

```
php artisan ai-docs:upload
```

#### Options

[](#options-2)

- `--dir=path/to/docs` - Directory containing neuron.store and index.json
- `--neuron-store=path` - Path to neuron.store file
- `--index=path` - Path to index.json file
- `--agent=name` - Agent name (overrides config)
- `--check-status` - Check AI service status before uploading

#### Configuration

[](#configuration)

Enable upload in your `.env`:

```
AI_DOCS_UPLOAD_ENABLED=true
AI_SERVICE_URL=http://localhost:8000
AI_SERVICE_API_KEY=your-api-key-here
AI_DOCS_AGENT_NAME=documentation
```

Configuration
-------------

[](#configuration-1)

### Layout Files

[](#layout-files)

Configure which files provide context for documentation generation:

```
'layout_files' => [
    'router' => 'resources/js/router/index.js',
    'navigation' => 'resources/js/components/Navigation_modules',
    'layouts' => 'resources/js/layouts',
],
```

### Generation Settings

[](#generation-settings)

```
'generation' => [
    'max_depth' => 5,              // Max component crawl depth
    'chunk_size' => 2000,          // Characters per chunk
    'concurrency' => 1,            // Concurrent requests
    'memory_limit' => 40,          // Memory messages to keep
    'output_dir' => 'storage/app/ai_docs/frontend',
    'cache_navigation' => true,
],
```

### Route Links

[](#route-links)

```
'route_links' => [
    'enabled' => true,
    'base_url' => env('APP_URL', 'http://localhost'),
    'include_related' => true,
    'max_related' => 5,
],
```

### Documentation Structure

[](#documentation-structure)

Control which sections are included in generated documentation:

```
'structure' => [
    'include_overview' => true,
    'include_navigation' => true,
    'include_layout' => true,
    'include_step_by_step' => true,
    'include_examples' => true,
    'include_troubleshooting' => true,
    'include_related_pages' => true,
    'include_route_links' => true,
],
```

Output
------

[](#output)

Generated documentation is stored in:

- **Markdown**: `storage/app/ai_docs/frontend/{slug}.md`
- **JSON**: `storage/app/ai_docs/frontend/{slug}.json`

Each document includes:

1. Overview &amp; Purpose
2. Navigation Instructions (role-specific)
3. Page Layout Description
4. Step-by-Step User Guide
5. Common Tasks &amp; Examples
6. Troubleshooting &amp; FAQ
7. Related Pages with Links

License
-------

[](#license)

MIT License

Credits
-------

[](#credits)

Developed by SchoolTry Team

###  Health Score

20

—

LowBetter than 14% of packages

Maintenance52

Moderate activity, may be stable

Popularity11

Limited adoption so far

Community2

Small or concentrated contributor base

Maturity12

Early-stage or recently created project

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

### Community

Maintainers

![](https://www.gravatar.com/avatar/d51ca358453c87dfe6019500749d0febaf476c4ea237de5c7604190332940d2a?d=identicon)[saidabdul80](/maintainers/saidabdul80)

### Embed Badge

![Health badge](/badges/schooltry-ai-documentation-generator/health.svg)

```
[![Health](https://phpackages.com/badges/schooltry-ai-documentation-generator/health.svg)](https://phpackages.com/packages/schooltry-ai-documentation-generator)
```

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
