unocha / ocha_ai
OCHA AI module
v1.18.0
2026-03-11 03:26 UTC
Requires
- php: >=8.3
- aws/aws-sdk-php: ^3.283
- drupal/honeypot: ^2
- nitotm/efficient-language-detector: ^3.0
- openai-php/client: ^0.7
- reliefweb/simple-autocomplete: ^v1.3
- reliefweb/simple-datepicker: ^v1.3
- symfony/uid: ^6.3
Requires (Dev)
- dev-develop
- v1.18.0
- v1.17.0
- v1.16.0
- v1.15.0
- v1.14.1
- v1.14.0
- v1.13.0
- v1.12.0
- v1.11.0
- v1.10.0
- v1.9.0
- v1.8.1
- v1.8.0
- v1.7.1
- v1.7.0
- v1.6.1
- v1.6.0
- v1.5.1
- v1.5.0
- v1.4.5
- v1.4.4
- v1.4.3
- v1.4.2
- v1.4.1
- v1.4.0
- v1.3.5
- v1.3.4
- v1.3.3
- v1.3.2
- v1.3.1
- v1.3.0
- v1.2.0
- v1.1.1
- v1.1.0
- v1.0.8
- v1.0.7
- v1.0.6
- v1.0.5
- v1.0.4
- v1.0.3
- v1.0.2
- v1.0.1
- v1.0.0
- dev-main
- dev-RW-1462
- dev-RW-1439
- dev-RW-1438
- dev-ops-11475-d11
- dev-ops-11475-2
- dev-ops-11475
- dev-RW-1220
- dev-RW-1172
- dev-OPS-11332-nova-models
- dev-coding-standards-fixes
- dev-RW-1149
- dev-RW-1054
- dev-RW-1109
- dev-RW-1107
- dev-RW-1052
- dev-fix-bedrock-titan-premier-payload
- dev-RW-1057
- dev-fix-bedrock-payload
- dev-RW-1051
- dev-RW-1047
- dev-RW-1044-context-expansion
- dev-RW-1019-icon-fix
- dev-RW-1037
- dev-RW-1033
- dev-RW-1019-fix-php-notice
- dev-RW-1019-fix
- dev-RW-1022-logging
- dev-honeypot-service-fix
- dev-RW-1012-instructions-as-bubbles
- dev-RW-1010-ajax-progress-message-styling
- dev-RW-996
- dev-RW-944
- dev-ops-10278-ai-stats-fix
- dev-use-cache-for-embeddings
- dev-RW-931-tagger-settings
- dev-refactor-tagger-2
- dev-cafuego/config-whine
- dev-fix-text-splitter
- dev-refactor-tagger
- dev-cs1
- dev-variable-name
- dev-elasticsearch-settings
- dev-chat-form-settings
- dev-attributes
This package is auto-updated.
Last update: 2026-03-11 03:27:01 UTC
README
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
The module defines these plugin types, 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
- MuPDF (for PDF extraction):
apt install mupdf-tools
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;