Download the PHP package semhoun/neuron-paradedb without Composer

On this page you can find all versions of the php package semhoun/neuron-paradedb. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package neuron-paradedb

ParadeDB for Neuron AI

English | Français

Vector similarity and BM25 hybrid search in PostgreSQL for PHP RAG applications using Neuron AI.

Overview

semhoun/neuron-paradedb connects Neuron AI to ParadeDB through PDO. It combines cosine-distance semantic search and BM25 lexical search using Reciprocal Rank Fusion (RRF). Documents, embeddings and metadata share one table, without a separate search service or PHP ParadeDB client.

Collections separate documents within that table. Neuron AI's typed filters apply to searches and deletions.

Technologies and Compatibility

Layer Technology
Language PHP ^8.1, extensions pdo, pdo_pgsql and curl for Neuron
RAG integration Neuron AI ^4.0
Storage and search ParadeDB 0.25.9-pg18, PostgreSQL 18, extensions vector and pg_search
Data access PDO PostgreSQL, bound parameters, JSONB metadata
Quality PHPUnit, PHPStan level 6, PHP CS Fixer
Continuous integration GitHub Actions; Docker Compose test database

Since version 3.0.0, the package's major version follows Neuron AI's major version. Minor and patch versions remain independent.

Package Neuron AI Branch
3.x ^3.0 3.x
4.x ^4.0 main

The examples below target Neuron AI 4. Package 4.x does not support Neuron AI 3.

Architecture

HybridRetrieval embeds a message's text, combines mandatory filters with AND, then calls the hybrid store. ParadeDBVectorStore validates documents and delegates filter compilation to ParadeDBFilterCompiler before executing PDO queries.

Installation

Prerequisites

From your consuming application:

Configuration

The library receives a PDO connection and does not load .env files. Supply these variables to the PHP process to use the examples:

Variable Purpose
PARADEDB_DSN PDO PostgreSQL DSN for the target database
PARADEDB_USER PostgreSQL role
PARADEDB_PASSWORD Password, supplied outside the repository
OPENAI_API_KEY OpenAI provider key, only for this example
PARADEDB_PORT Local Compose port, defaults to 55432

Initialize the Store

Run provisioning explicitly with an administrative role, not on every application request:

The constructor enables PDO exceptions and checks an existing table for compatibility without creating objects. setupDatabase() creates missing extensions, the table and indexes; it is not a migration tool. An incompatible embedding dimension is rejected.

Table names must be single ASCII identifiers of at most 48 characters, without schema qualification. Letters and underscores are allowed initially, followed by letters, underscores or digits. Use a trusted, fixed search_path.

Ingest and Search

The following blocks reuse the store initialized above. Use embeddings with the same dimension and model for ingestion and retrieval.

For an existing agent extending NeuronAI\RAG\RAG, with its AI provider already configured:

This repository has no application server or startup command: these components run within your PHP application.

Collections and Filters

forCollection() returns a clone sharing PDO, the schema and options, without executing SQL or mutating the original. Pass the same collection-scoped store to the agent and its retrieval strategy.

Declare filterable metadata in a schema. Native fields sourceType and sourceName are also available:

The optional schema defaults to DocumentSchema::default(). Metadata remains stored as JSON; only declared filterable fields and native fields can be filtered. Use Document getters/setters, not public properties.

Operators: eq, neq, in, numeric gt/gte/lt/lte, containsAny/containsAll for string arrays, and FilterGroup::allOf/anyOf groups. neq requires a required field. Null comparisons, undeclared fields, incompatible values and raw filters are rejected before execution.

Values and metadata keys are bound parameters; JSONB preserves scalar types. The collection constraint, strategy filters and per-call filters are combined with AND. An OR group cannot widen those scopes. Calls do not mutate store defaults.

The schema validates new documents but does not migrate or revalidate historical metadata. Audit existing data before adding a required field or changing its type.

Writes and Scores

Provisioning and Migration

Production Permissions

setupDatabase() runs CREATE EXTENSION IF NOT EXISTS for vector and pg_search, then creates the table and indexes. Use a provisioning role permitted to create those extensions, create objects in the schema and manage the table's indexes. The extensions must be installed on the server.

After provisioning, a separate, existing application role, named neuron_app here, needs only:

Integration tests verify writes, searches and deletions without identity-sequence privileges on the pinned ParadeDB image. This applies to GENERATED ALWAYS AS IDENTITY, not arbitrary sequences or SERIAL. Do not call setupDatabase() with the restricted role; permission errors are propagated.

The repository provides no application deployment or production compilation step. compose.yaml is for testing only. Keep PostgreSQL credentials out of source code.

Legacy 1.0 Tables

The schema introduced in 1.1 is required, even without named collections. The constructor and setupDatabase() reject legacy tables without migrating them. Run this static method before constructing the store, using a table-owner connection and the existing dimension:

The migration adds collection_id TEXT NOT NULL DEFAULT '', replaces the primary key with (collection_id, id), adds a unique search_id BIGINT GENERATED ALWAYS AS IDENTITY and rebuilds BM25 on (search_id, content). Documents, metadata and the HNSW index are preserved; existing documents belong to the null scope.

The operation is transactional with an exclusive lock, or uses a savepoint within an existing transaction. Locks can then last until that transaction ends. Errors roll back changes; external dependencies are never removed with CASCADE. An already migrated table remains unchanged except for a missing BM25 index being created. Missing or partially migrated tables are rejected.

Back up the database, test migration and rollback on a copy, then schedule maintenance without application access. Do not mix versions 1.0 and 1.1 against the same table or run this migration on every request. New installations use setupDatabase() directly.

Moving from package 3.x to 4.x requires updating Neuron and Document access, but no new physical migration.

Development and Testing

The three unit test files cover validation, filter compilation and hybrid retrieval without a database or API key. The integration test file covers schema, scores, collections, filters, upserts, transactions/savepoints, migrations and restricted permissions.

For local integration tests, use only a disposable database with administrative privileges. Compose exposes it on localhost. Export PARADEDB_USER and PARADEDB_PASSWORD using the test values defined in compose.yaml, then run:

Tests create and remove temporary tables and a restricted role. Without PARADEDB_DSN, they are skipped. The final command removes the containers and associated volumes.

CI configures PHP 8.1 through 8.5, including a PHP 8.1 job with lowest dependencies. Integration uses PHP 8.3 and paradedb/paradedb:0.25.9-pg18. Previously recorded local validation used PHP 8.5.10, Neuron AI 4.0.0, PostgreSQL 18.6 and pgvector 0.8.4. Later ParadeDB versions are not yet qualified.

Contributing

  1. Fork the repository and create a dedicated branch.
  2. Add relevant tests in tests/Unit or tests/Integration.
  3. Run the validation commands above, and integration tests for SQL changes.
  4. Use composer style to apply formatting, then open a pull request describing the change.

License

MIT. Copyright 2026 Nathanael (semhoun).


All versions of neuron-paradedb with dependencies

PHP Build Version
Package Version
Requires php Version ^8.1
ext-pdo Version *
ext-pdo_pgsql Version *
neuron-core/neuron-ai Version ^4.0
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package semhoun/neuron-paradedb contains the following files

Loading the files please wait ...