Skip to main content

Prerequisites

ComponentVersionNotes
PHP^8.3The application targets PHP 8.3+.
Laravel^13.0Framework.
ComposerlatestPHP dependency manager.
Node.js20+Builds the React SPA + Vite assets.
PostgreSQL≥ 15With the pgvector extension.
Sanctum^4.2Ships with the app; powers SPA + token auth.
SQLite is used only for the automated test suite (the vector(N) columns swap to JSON text via the test migrations). Production and development run on PostgreSQL + pgvector.

1. Install dependencies

git clone https://github.com/lopadova/AskMyDocs.git
cd AskMyDocs
composer install
npm install && npm run build
cp .env.example .env
php artisan key:generate

2. Provision PostgreSQL + pgvector

pgvector must exist in the target database before migrating:
CREATE DATABASE askmydocs;
\c askmydocs
CREATE EXTENSION IF NOT EXISTS vector;
Then point .env at it:
DB_CONNECTION=pgsql
DB_HOST=127.0.0.1
DB_PORT=5432
DB_DATABASE=askmydocs
DB_USERNAME=postgres
DB_PASSWORD=secret

3. Choose AI providers

Chat and embeddings are configured separately — Anthropic, for example, has no embeddings endpoint, so you pair it with an embeddings-capable provider.
AI_PROVIDER=openai            # chat: openai | anthropic | gemini | openrouter | regolo
AI_EMBEDDINGS_PROVIDER=openai # embeddings: openai | openrouter | gemini | regolo
OPENAI_API_KEY=sk-...
When AI_PROVIDER=anthropic and AI_EMBEDDINGS_PROVIDER is empty, AskMyDocs auto-selects the first embeddings-capable provider with a configured key in a dimension-safety-first order (openai → openrouter → regolo → gemini), so a deployment never silently corrupts ingest writes with a mismatched dimension. See AI providers for the full matrix.

4. Migrate

php artisan migrate

  1. Embedding dimensions

The embedding dimension is part of the schema contract. The stock vector(N) columns are sized for 1536 dimensions (openai/text-embedding-3-small, the default, which also matches OpenRouter’s default embeddings model). Choosing a different-dimension model — e.g. qwen/qwen3-embedding-4b at 2560 dims — requires all three of:
  1. migrating the vector(N) columns to the new dimension,
  2. flushing embedding_cache,
  3. re-indexing the corpus (re-ingest).
Mixing dimensions silently corrupts retrieval. Pick the embeddings model before your first ingest.

6. Run it

php artisan serve          # http://localhost:8000
php artisan queue:work     # processes IngestDocumentJob + canonical indexing
Open /app for the SPA (chat + admin), or hit the JSON API directly. Create your first admin user with the role seeder / auth:grant command (see Admin panel).

Scheduler

Several rotations run on the Laravel scheduler (bootstrap/app.php). Enable the system cron entry so they fire:
* * * * * cd /path/to/AskMyDocs && php artisan schedule:run >> /dev/null 2>&1
Time (UTC)CommandPurpose
03:10kb:prune-embedding-cacheLRU cache rotation
03:20chat-log:prunechat-log retention
03:30kb:prune-deletedhard-delete expired soft-deletes
03:40kb:rebuild-graphcanonical graph rebuild
All commands accept --days=N and --project= overrides; 0 disables the corresponding rotation.

Next steps

Quickstart

Ingest and ask your first question.

Configuration reference

Every env knob, grouped by subsystem.