PHPackages                             monarc/copilot - 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. monarc/copilot

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

monarc/copilot
==============

MONARC Copilot module for FrontOffice

v0.1.0(3mo ago)16AGPL-3.0-or-laterPHPPHP ^8.1

Since Apr 23Pushed 1mo agoCompare

[ Source](https://github.com/monarc-project/monarc-copilot)[ Packagist](https://packagist.org/packages/monarc/copilot)[ Docs](https://github.com/monarc-project/monarc-copilot)[ RSS](/packages/monarc-copilot/feed)WikiDiscussions main Synced 3w ago

READMEChangelogDependencies (6)Versions (2)Used By (0)

MONARC Copilot
==============

[](#monarc-copilot)

MONARC Copilot is a FrontOffice module that adds a copilot endpoint and supporting services for contextual guidance inside MONARC ANR workflows.

Features
--------

[](#features)

- Provides a copilot API route under the FrontOffice ANR API.
- Builds contextual answers from ANR workflow state and selected objects or risks.
- Supports optional response refinement through an Ollama-compatible or OpenAI-style chat endpoint.

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

[](#requirements)

- PHP 8.1+
- Composer
- MONARC FrontOffice 2.13+

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

[](#installation)

```
composer require monarc/copilot
```

Enable the module in your MONARC FrontOffice application:

1. Add the module name in `config/application.config.php` if it is not already present: ```
    'Monarc\Copilot',
    ```
2. Ensure the Laminas module symlink exists: ```
    mkdir -p module/Monarc
    ln -sfn ./../../vendor/monarc/copilot module/Monarc/Copilot
    ```
3. Add the FrontOffice feature flag in `config/autoload/local.php`: ```
    'isCopilotEnabled' => true,
    ```
4. Create `config/autoload/copilot.local.php` from `config/autoload/copilot.local.php.dist` and configure the LLM connection.
5. Refresh linked assets: ```
    ./scripts/link_modules_resources.sh
    ```

For Docker-based FrontOffice deployments, the entrypoint can generate `copilot.local.php` and recreate the Copilot symlinks from environment variables on container startup.

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

[](#configuration)

The module exposes a `copilot` config section in [`config/module.config.php`](config/module.config.php).

Example options:

- `copilot.maxRecommendations`
- `copilot.maxSources`
- `copilot.ollama.enabled`
- `copilot.ollama.transport`
- `copilot.ollama.baseUrl`
- `copilot.ollama.endpointPath`
- `copilot.ollama.model`
- `copilot.ollama.apiKey`
- `copilot.ollama.jsonMode`
- `copilot.ollama.timeout`

Example:

```
