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)6553MITPHPPHP ^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 2d 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

24

—

LowBetter than 31% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity15

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity43

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

886d 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

[spatie/laravel-pdf

Create PDFs in Laravel apps

1.0k4.8M47](/packages/spatie-laravel-pdf)[laravel/ai

The official AI SDK for Laravel.

1.0k3.2M201](/packages/laravel-ai)[dedoc/scramble

Automatic generation of API documentation for Laravel applications.

2.1k11.2M101](/packages/dedoc-scramble)[moonshine/moonshine

Laravel administration panel

1.3k253.1k81](/packages/moonshine-moonshine)[maestroerror/laragent

Power of AI Agents in your Laravel project

639159.9k](/packages/maestroerror-laragent)[spatie/laravel-passkeys

Use passkeys in your Laravel app

471890.7k39](/packages/spatie-laravel-passkeys)

PHPackages © 2026

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