PHPackages                             laravelailabs/file-assistant - 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. [PDF &amp; Document Generation](/categories/documents)
4. /
5. laravelailabs/file-assistant

ActiveLibrary[PDF &amp; Document Generation](/categories/documents)

laravelailabs/file-assistant
============================

Chat with files using AI

0.0.12(2y ago)5553MITPHPPHP ^8.1

Since Jan 27Pushed 2y agoCompare

[ Source](https://github.com/LaravelAILabs/file-assistant)[ Packagist](https://packagist.org/packages/laravelailabs/file-assistant)[ Docs](https://github.com/laravelailabs/file-assistant)[ Fund](https://github.com/sponsors/adrianmtanase)[ Fund](https://patreon.com/AdrianTanase443)[ RSS](/packages/laravelailabs-file-assistant/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (3)Dependencies (16)Versions (4)Used By (0)

Laravel AI File Assistant
=========================

[](#laravel-ai-file-assistant)

[![Latest Version on Packagist](https://camo.githubusercontent.com/19c9c18906f0cc19c4db01928fc6a6a2bf2a8051e82d4160f296f21b171fe0ba/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f6c61726176656c61696c6162732f66696c652d617373697374616e742e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/laravelailabs/file-assistant)[![GitHub Tests Action Status](https://camo.githubusercontent.com/bc335b46cf814d4a16b9c29351a88908b7171b18e65d610087236e275fe100fc/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f616374696f6e732f776f726b666c6f772f7374617475732f6c61726176656c61696c6162732f66696c652d617373697374616e742f72756e2d74657374732e796d6c3f6272616e63683d6d61696e266c6162656c3d7465737473267374796c653d666c61742d737175617265)](https://github.com/laravelailabs/file-assistant/actions?query=workflow%3Arun-tests+branch%3Amain)[![GitHub Code Style Action Status](https://camo.githubusercontent.com/63abc504cdfc981d81d693c081917a37df75d86daa09f4e11fd64d5dcdc0ed7d/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f616374696f6e732f776f726b666c6f772f7374617475732f6c61726176656c61696c6162732f66696c652d617373697374616e742f6669782d7068702d636f64652d7374796c652d6973737565732e796d6c3f6272616e63683d6d61696e266c6162656c3d636f64652532307374796c65267374796c653d666c61742d737175617265)](https://github.com/laravelailabs/file-assistant/actions?query=workflow%3A%22Fix+PHP+code+style+issues%22+branch%3Amain)[![Total Downloads](https://camo.githubusercontent.com/53125ce6b787506c307993234371a7736ffa7f3bc41c37a8779965f03e76078a/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f6c61726176656c61696c6162732f66696c652d617373697374616e742e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/laravelailabs/file-assistant)

Analyzes files based on AI and offers the possibility to query them.

Support us
----------

[](#support-us)

If this helped you, consider supporting my development over on [Patreon](https://patreon.com/AdrianTanase443) or on [Github](https://github.com/sponsors/adrianmtanase).

Demo
----

[](#demo)

Repository: [LaravelAILabs/file-assistant-demo](https://github.com/LaravelAILabs/file-assistant-demo)

URL:

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

[](#installation)

You can install the package via composer:

```
composer require laravelailabs/file-assistant
```

You can publish the config file with:

```
php artisan vendor:publish --tag="file-assistant-config"
```

Setup
-----

[](#setup)

Currently using [Pinecone.io](https://pinecone.io) as the vector database and [OpenAI](https://openai.com/) as the LLM. Planning to make it so any LLM can be used, as well as any Vector Database implemented in [Laravel Vector Store](adrianmtanase/laravel-vector-store).

Add the following secrets to your `.env`:

```
VECTOR_STORE_PINECONE_API_KEY=YOUR_PINECONE_API_KEY
VECTOR_STORE_PINECONE_ENVIRONMENT=YOUR_PINECONE_ENVIRONMENT
FILE_ASSISTANT_OPENAI_API_KEY=YOUR_OPENAPI_KEY
FILE_ASSISTANT_PINECONE_DATASET=YOUR_PINECONE_INDEX_NAME
```

You can find your [OpenAI API Key here](https://platform.openai.com/api-keys).

Usage
-----

[](#usage)

#### 1. Start a new conversation

[](#1-start-a-new-conversation)

```
$dialog = FileAssistant::addFile('PATH_TO_YOUR_FILE')
                             ->addFile('PATH_TO_YOUR_SECOND_FILE')
                             ->initialize();

echo $dialog->prompt('What is this document about?')
```

#### 2. Resume a conversation

[](#2-resume-a-conversation)

```
$dialog = FileAssistant::setConversation(Conversation::find(1))
                             ->setUser(Auth::user())
                             ->initialize();

// grab the conversation and display the messages
/**
* @var \LaravelAILabs\FileAssistant\Models\Conversation $conversation
 */
$conversation = $dialog->getConversation();
foreach ($conversation->messages as $message) {
    echo sprintf('%s: %s ', $message->role, $message->content);
}

echo $dialog->prompt('Where did we leave off?')
```

#### 3. Grab messages and display

[](#3-grab-messages-and-display)

The package creates 3 tables: `conversations`, `messages`, `files`, `conversation_files`. Feel free to modify their names using the [file-assistant config](https://github.com/LaravelAILabs/file-assistant/blob/main/config/file-assistant.php) environment variables. Use the models to interact with the database and display the messages of a conversation.

Works with
----------

[](#works-with)

- PDF
- Word
- TXT

Testing
-------

[](#testing)

```
composer test
```

Changelog
---------

[](#changelog)

Please see [CHANGELOG](CHANGELOG.md) for more information on what has changed recently.

Credits
-------

[](#credits)

- [Adrian Tanase](https://github.com/adrianmtanase)
- [All Contributors](../../contributors)

License
-------

[](#license)

The MIT License (MIT). Please see [License File](LICENSE.md) for more information.

###  Health Score

23

—

LowBetter than 27% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity15

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity42

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

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.

###  Release Activity

Cadence

Every ~1 days

Total

3

Last Release

830d ago

### Community

Maintainers

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

---

Top Contributors

[![adrianmtanase](https://avatars.githubusercontent.com/u/153947873?v=4)](https://github.com/adrianmtanase "adrianmtanase (26 commits)")

---

Tags

laravelpdfaifileswordtextchatLaravel AI Labsfile-assistant

###  Code Quality

TestsPHPUnit

Static AnalysisPHPStan

Code StyleLaravel Pint

### Embed Badge

![Health badge](/badges/laravelailabs-file-assistant/health.svg)

```
[![Health](https://phpackages.com/badges/laravelailabs-file-assistant/health.svg)](https://phpackages.com/packages/laravelailabs-file-assistant)
```

###  Alternatives

[barryvdh/laravel-snappy

Snappy PDF/Image for Laravel

2.8k24.8M48](/packages/barryvdh-laravel-snappy)[spatie/laravel-pdf

Create PDFs in Laravel apps

9963.4M11](/packages/spatie-laravel-pdf)[maestroerror/laragent

Power of AI Agents in your Laravel project

630106.4k](/packages/maestroerror-laragent)[vormkracht10/laravel-mails

Laravel Mails can collect everything you might want to track about the mails that has been sent by your Laravel app.

24149.7k](/packages/vormkracht10-laravel-mails)[aspose-cloud/aspose-words-cloud

Open, generate, edit, split, merge, compare and convert Word documents. Integrate Cloud API into your solutions to manipulate documents. Convert PDF to Word (DOC, DOCX, ODT, RTF and HTML) and in the opposite direction.

32157.4k](/packages/aspose-cloud-aspose-words-cloud)[nilgems/laravel-textract

A Laravel package to extract text from files like DOC, XL, Image, Pdf and more. I've developed this package by inspiring "npm textract".

195.2k](/packages/nilgems-laravel-textract)

PHPackages © 2026

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