Download the PHP package nahid-hasan/ai-notes without Composer

On this page you can find all versions of the php package nahid-hasan/ai-notes. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package ai-notes

๐Ÿง  ollama-notes-laravel-package (ai-notes)

Latest Version on Packagist Total Downloads

Turn your Laravel app into an AI-powered memory system.

Record a voice note or write text. Search it later using natural language โ€” not keywords. No OpenAI account needed. Runs 100% locally and free with Ollama + Whisper.


Features


Requirements

Requirement Version
PHP ^8.2
Laravel ^11.0
PostgreSQL ^14 + pgvector extension
Redis Any

For the free local AI stack (recommended): Docker is required to run Ollama and Whisper containers.
For OpenAI: just an API key, no Docker needed for AI services.


Installation

1. Install the package

2. Run the install command

This publishes the config file and migrations.

3. Run migrations

This creates the ai_notes table and enables the pgvector extension automatically.


Setup: Free Local Stack (Recommended)

This uses Ollama (summarization + embeddings) and Whisper (transcription) โ€” both running in Docker, zero cost, zero API keys.

Step 1 โ€” Add Docker services

Copy this into your docker-compose.yml:

For the complete docker-compose.yml with Whisper Dockerfile and Flask server, see Docker Setup below.

Step 2 โ€” Pull the AI models

First pull is ~2-4GB. After that, restarts are instant.

Step 3 โ€” Configure your .env

Step 4 โ€” Start the queue worker

That's it. You're running fully local AI.


Setup: OpenAI (Paid Alternative)

If you prefer OpenAI and already have an API key:

No Ollama or Whisper needed. Everything else works identically.

Note: When switching from Ollama (768 dims) to OpenAI (1536 dims), you need to re-run migrations with the correct dimension. Set AI_NOTES_VECTOR_DIM=1536 in .env before migrating.


Usage

Storing Notes

From audio (voice note):

From text:


Checking Processing Status

AI processing is async. Poll the status or use a webhook/event:


Searching Notes

How distance scores work:

Distance Meaning
0.0 โ€“ 0.3 Highly relevant
0.3 โ€“ 0.5 Related / probably useful
0.5 โ€“ 0.7 Loosely related
0.7 โ€“ 1.0 Not really related

Asking Questions (RAG)


Working with the Model Directly


Complete API Reference

AINote::fromAudio(UploadedFile $file, ?int $userId = null): AINote

Upload an audio file. Queues transcription โ†’ summarization โ†’ embedding. Returns the note immediately with status = "pending".

AINote::fromText(string $text, ?int $userId = null, ?string $title = null): AINote

Store a text note. Queues summarization โ†’ embedding. Returns the note immediately with status = "pending".

AINote::search(string $query, int $limit = 5, ?int $userId = null): Collection

Semantic search across all done notes. Returns an Eloquent Collection sorted by relevance. Each result includes a distance attribute.

AINote::ask(string $question, int $contextLimit = 3, ?int $userId = null): string

RAG-powered question answering. Finds the most relevant notes, builds context, and asks the AI to answer your question based on them. Returns a plain string answer.


Configuration

Publish and edit config/ai-notes.php:


Docker Setup

Full docker-compose.yml for a new project using this package:

docker/whisper/Dockerfile:

docker/whisper/server.py:


Testing

The package ships with a FakeAIProvider so your tests never hit real AI services:

Customise fake responses:


Custom AI Driver

Implement the AIProvider contract to use any AI provider:

Register it in a service provider:


Troubleshooting

SQLSTATE: type "vector" does not exist
You're using plain PostgreSQL without pgvector. Use the pgvector/pgvector:pg16 Docker image instead of postgres:16.

Notes stuck on pending status
Your queue worker isn't running. Start it:

Ollama returns empty embeddings
The model isn't pulled yet:

Whisper is slow on first request
Normal โ€” it loads the model into memory on first call (~10-15 seconds). Subsequent calls are fast.

distance is always high (>0.8) for all results
Your notes were embedded with a different model than your search query. If you switched from Ollama to OpenAI (or vice versa), re-process your notes:

Notes have status = failed
Check storage/logs/laravel.log for the error. Common causes: Ollama not running, Whisper unreachable, or audio file format not supported by Whisper.


Roadmap


Contributing

Contributions are welcome. Please:

  1. Fork the repo
  2. Create a feature branch: git checkout -b feature/my-feature
  3. Write tests for your changes
  4. Submit a PR against main

License

The MIT License. See LICENSE for details.


All versions of ai-notes with dependencies

PHP Build Version
Package Version
Requires php Version ^8.2
laravel/framework Version ^11.0 || ^12.0 || ^13.0
guzzlehttp/guzzle Version ^7.0
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package nahid-hasan/ai-notes contains the following files

Loading the files please wait ...