PHPackages                             unocha/ocha\_ai - 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. unocha/ocha\_ai

ActiveDrupal-module

unocha/ocha\_ai
===============

OCHA AI module

v1.19.0(2mo ago)14.5k1GPL-2.0-or-laterPHPPHP &gt;=8.3CI passing

Since Feb 15Pushed 2mo ago4 watchersCompare

[ Source](https://github.com/UN-OCHA/ocha_ai)[ Packagist](https://packagist.org/packages/unocha/ocha_ai)[ RSS](/packages/unocha-ocha-ai/feed)WikiDiscussions develop Synced 1mo ago

READMEChangelog (10)Dependencies (19)Versions (92)Used By (1)

OCHA AI Module
==============

[](#ocha-ai-module)

Adds AI integration to UN OCHA Drupal sites. The module provides various **plugin types** (sources, text extraction, embeddings, vector store, completion, etc.) and configuration so that other modules or custom code can inject the plugin managers and orchestrate flows such as RAG. Configure plugins at **Administration → Configuration → OCHA AI** (`/admin/config/ocha-ai`).

Plugins
-------

[](#plugins)

The module defines these [plugin types](src/Attribute), each with its own plugin manager:

- **Completion** — LLM answer generation (e.g. AWS Bedrock, Azure OpenAI)
- **Embedding** — generate embeddings (e.g. AWS Bedrock, Azure OpenAI)
- **Source** — document sources (e.g. ReliefWeb)
- **Text extractor** — extract text from files (e.g. MuPDF for PDFs)
- **Text splitter** — split text into passages (sentence, token, nlp\_sentence)
- **Vector store** — store and retrieve embeddings (Elasticsearch, Elasticsearch Flattened, Elasticsearch Job)
- **Answer validator** — validate answers (similarity\_embedding, similarity\_ranker)
- **Ranker** — rank passages (e.g. ocha\_ai\_helper\_ranker)

Default plugin set: ReliefWeb source, MuPDF extractor, token splitter, AWS Bedrock completion/embedding, Elasticsearch vector store.

Dependencies
------------

[](#dependencies)

- **MuPDF** (for PDF extraction): `apt install mupdf-tools`

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

[](#configuration)

Optional overrides can be set in `settings.php` or via the config UI. Example:

```
$config['ocha_ai.settings']['plugins']['text_extractor']['mupdf']['mutool'] = '/usr/bin/mutool';

$config['ocha_ai.settings']['plugins']['vector_store']['elasticsearch']['url'] = 'http://elasticsearch:9200';
$config['ocha_ai.settings']['plugins']['vector_store']['elasticsearch']['indexing_batch_size'] = 10;
$config['ocha_ai.settings']['plugins']['vector_store']['elasticsearch']['topk'] = 5;

$config['ocha_ai.settings']['plugins']['completion']['aws_bedrock']['region'] = '';
$config['ocha_ai.settings']['plugins']['completion']['aws_bedrock']['api_key'] = '';
$config['ocha_ai.settings']['plugins']['completion']['aws_bedrock']['api_secret'] = '';
$config['ocha_ai.settings']['plugins']['completion']['aws_bedrock']['model'] = 'amazon.titan-text-express-v1';
$config['ocha_ai.settings']['plugins']['completion']['aws_bedrock']['version'] = '';
$config['ocha_ai.settings']['plugins']['completion']['aws_bedrock']['max_tokens'] = 512;

$config['ocha_ai.settings']['plugins']['embedding']['aws_bedrock']['region'] = '';
$config['ocha_ai.settings']['plugins']['embedding']['aws_bedrock']['api_key'] = '';
$config['ocha_ai.settings']['plugins']['embedding']['aws_bedrock']['api_secret'] = '';
$config['ocha_ai.settings']['plugins']['embedding']['aws_bedrock']['model'] = 'amazon.titan-embed-text-v1';
$config['ocha_ai.settings']['plugins']['embedding']['aws_bedrock']['version'] = '';
$config['ocha_ai.settings']['plugins']['embedding']['aws_bedrock']['batch_size'] = 1;
$config['ocha_ai.settings']['plugins']['embedding']['aws_bedrock']['dimensions'] = 1536;
$config['ocha_ai.settings']['plugins']['embedding']['aws_bedrock']['max_tokens'] = 8192;
```

###  Health Score

53

—

FairBetter than 97% of packages

Maintenance87

Actively maintained with recent releases

Popularity23

Limited adoption so far

Community16

Small or concentrated contributor base

Maturity72

Established project with proven stability

 Bus Factor2

2 contributors hold 50%+ of commits

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 ~17 days

Recently: every ~63 days

Total

44

Last Release

63d ago

PHP version history (2 changes)v1.0.0PHP &gt;=8.2

v1.16.0PHP &gt;=8.3

### Community

Maintainers

![](https://www.gravatar.com/avatar/346443feed98de86efcea04bbc5094dc2a4146181bca1e8936beb6ac46eed455?d=identicon)[unocha](/maintainers/unocha)

---

Top Contributors

[![orakili](https://avatars.githubusercontent.com/u/696348?v=4)](https://github.com/orakili "orakili (186 commits)")[![attiks](https://avatars.githubusercontent.com/u/105144?v=4)](https://github.com/attiks "attiks (93 commits)")[![rupl](https://avatars.githubusercontent.com/u/254753?v=4)](https://github.com/rupl "rupl (84 commits)")[![lazysoundsystem](https://avatars.githubusercontent.com/u/67453?v=4)](https://github.com/lazysoundsystem "lazysoundsystem (21 commits)")[![cafuego](https://avatars.githubusercontent.com/u/148719?v=4)](https://github.com/cafuego "cafuego (17 commits)")

### Embed Badge

![Health badge](/badges/unocha-ocha-ai/health.svg)

```
[![Health](https://phpackages.com/badges/unocha-ocha-ai/health.svg)](https://phpackages.com/packages/unocha-ocha-ai)
```

###  Alternatives

[league/flysystem-aws-s3-v3

AWS S3 filesystem adapter for Flysystem.

1.6k263.6M790](/packages/league-flysystem-aws-s3-v3)[openai-php/laravel

OpenAI PHP for Laravel is a supercharged PHP API client that allows you to interact with the Open AI API

3.7k7.6M74](/packages/openai-php-laravel)[web-auth/webauthn-framework

FIDO2/Webauthn library for PHP and Symfony Bundle.

50570.7k1](/packages/web-auth-webauthn-framework)[api-platform/json-schema

Generate a JSON Schema from a PHP class

273.4M26](/packages/api-platform-json-schema)[symfony/ai-platform

PHP library for interacting with AI platform provider.

51927.7k136](/packages/symfony-ai-platform)[georgeboot/laravel-echo-api-gateway

Use Laravel Echo with API Gateway Websockets

10435.5k](/packages/georgeboot-laravel-echo-api-gateway)

PHPackages © 2026

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