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. [Utility &amp; Helpers](/categories/utility)
4. /
5. unocha/ocha\_ai

ActiveDrupal-module[Utility &amp; Helpers](/categories/utility)

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

OCHA AI module

v1.21.0(1mo ago)15.0k1GPL-2.0-or-laterPHPPHP &gt;=8.3CI passing

Since Feb 15Pushed 1mo 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 2d ago

READMEChangelog (10)Dependencies (37)Versions (96)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

55

—

FairBetter than 97% of packages

Maintenance94

Actively maintained with recent releases

Popularity24

Limited adoption so far

Community18

Small or concentrated contributor base

Maturity73

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

Recently: every ~28 days

Total

46

Last Release

30d 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 (190 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

[easycorp/easyadmin-bundle

Admin generator for Symfony applications

4.3k17.9M388](/packages/easycorp-easyadmin-bundle)[ecotone/ecotone

Enterprise architecture layer for Laravel and Symfony — CQRS, Event Sourcing, Durable Workflows (Sagas, Orchestrators), Projections, and Outbox messaging via PHP attributes.

564576.7k53](/packages/ecotone-ecotone)[tempest/framework

The PHP framework that gets out of your way.

2.2k34.4k15](/packages/tempest-framework)[rcsofttech/audit-trail-bundle

Enterprise-grade, high-performance Symfony audit trail bundle. Automatically track Doctrine entity changes with split-phase architecture, multiple transports (HTTP, Queue, Doctrine), and sensitive data masking.

1189.8k](/packages/rcsofttech-audit-trail-bundle)[symfony/ai-platform

PHP library for interacting with AI platform provider.

521.4M291](/packages/symfony-ai-platform)[altis/core

Core module for Altis

19228.0k3](/packages/altis-core)

PHPackages © 2026

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