Download the PHP package cognesy/instructor-retrieval without Composer

On this page you can find all versions of the php package cognesy/instructor-retrieval. 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 instructor-retrieval

InstructorPHP Retrieval

Vector storage, document indexing, semantic retrieval, and bounded RAG context for InstructorPHP. The package follows Symfony AI's composition model: one replaceable store contract is shared by direct vector persistence, the document processor/indexer, and retrieval. Instructor's facade and pending execution model remains the public orchestration surface.

Installation

The package bundles memory, pgvector, qdrant, typesense, meilisearch, weaviate, and milvus. The HTTP-backed drivers use Instructor's shared HTTP client; Pgvector requires ext-pdo and a configured PDO connection. Backend management is explicit through CanManageStore—constructing a store never creates or drops remote resources.

Configure bundled drivers

StoreConfig::metric selects the package-level metric; backend connection and schema values belong in options. StoreFactory resolves the configured name through the same replaceable registry used by the other InstructorPHP driver packages.

All drivers support bounded VectorQuery and reject ranked continuations. Their additional capabilities are deliberately backend-specific:

Driver Metrics Fetch Scan Search
memory cosine, dot product, Euclidean yes yes exact
pgvector cosine, dot product, Euclidean yes yes exact or configured HNSW
qdrant cosine, dot product, Euclidean yes yes approximate
typesense cosine, dot product yes yes approximate
meilisearch cosine yes yes approximate
weaviate cosine, dot product, Euclidean yes yes approximate
milvus cosine, dot product, Euclidean yes no approximate

The required and driver-specific options are:

Driver Required options Optional options
memory none none
pgvector pdo, table, dimensions approximate; relaxed_ordering must remain false
qdrant endpoint, collection, dimensions api_key, max_response_bytes
typesense endpoint, collection, dimensions api_key, max_response_bytes, max_scan_page_size
meilisearch endpoint, index, dimensions api_key, embedder, max_response_bytes, task_timeout_milliseconds, task_poll_milliseconds, max_scan_page_size
weaviate endpoint, collection, dimensions api_key, max_response_bytes, max_scan_page_size
milvus endpoint, collection, dimensions token, database, max_response_bytes, max_fetch_ids, max_content_bytes

Typesense rejects Euclidean configuration. Meilisearch uses a userProvided embedder and supports cosine only; setup and every mutation wait for terminal task success before returning. Weaviate requires an endpoint with /v1/graphql enabled. Milvus intentionally does not expose CanScanDocuments: its REST offset cap cannot satisfy the package's large-corpus traversal contract.

Weaviate and Milvus expose squared L2 values on the wire; their adapters return the square root so SearchScore consistently represents the package's actual Euclidean distance. Vectors remain omitted unless requested with Projection.

Store precomputed embeddings

Embedding generation is not required when vectors already exist.

VectorDocument is deliberately generic. Text, source/chunk provenance, and even content itself are optional. Search results omit vectors unless the caller explicitly requests them with Projection.

Index text and retrieve by meaning

DocumentIndexer delegates to DocumentProcessor; the processor owns filtering, transformation, bounded batching, vectorization, persistence, and stale-chunk cleanup. Vectorizer is a thin adapter over Polyglot Embeddings.

Use separate document/query Vectorizer instances when a provider requires different task options, while keeping both roles in the same declared embedding space. Known dimension or embedding-space mismatches fail explicitly.

Compose RAG without hiding generation

Retrieval never invokes an answering model. ContextAssembler selects textual evidence under exact rendered byte, token, evidence-count, and excerpt limits; the application then passes that untrusted evidence to Inference or StructuredOutput.

The returned AssembledContext includes the exact citation map. Empty or content-free hits produce an explicit empty context; the application chooses whether to abstain, ask a follow-up question, or answer without evidence.

Traverse large corpora

Ranked retrieval always returns one bounded page. Corpus traversal is a separate scan capability with a forward-only cursor that releases previous pages.

Do not use ranked search as an export API. Drivers expose truthful capabilities for ranked continuation, scan, fetch, exact/approximate behavior, and ordering.

Agents

packages/agents depends on this package and provides UseRetrieval. It installs a stateless, bounded retrieval_search tool and optionally a retrieval_read tool. Reads require an application-supplied CanReadRetrievalEvidence implementation, which is the authorization boundary for execution, tenant, and collection scope. The generic AgentLoop has no vector-store dependency.

Multimodal content

The storage contract already accepts vectors for products, images, audio, or any other modality because a record does not require text. Applications can store externally generated multimodal embeddings and keep typed asset references in metadata. The bundled document processor, SemanticQueryVectorizer, and ContextAssembler are intentionally text-first in this release because Polyglot's current embeddings request is string-based. They do not silently flatten binary/image/audio inputs into text.

First-party multimodal vectorization should be added when Polyglot exposes a typed multimodal embeddings input. Multimodal RAG will then need a content-part evidence representation and modality-aware budgets; until then, hydrate an authorized asset reference in application code and pass it to the existing multimodal inference APIs.

Observability and safety

Retrieval and indexing dispatch lifecycle, store-attempt, and progress events through the shared events/logging stack. RetrievalTelemetryProjector maps a retrieval lifecycle to trace-ready data. Default events contain correlation IDs, driver/query types, counts, durations, and error classes—not vectors, credentials, query text, or retrieved content.

All HTTP-driver response bodies are capped before complete JSON decoding. Pgvector reads rows incrementally and closes PDO cursors explicitly. Store scans and retrieval tools remain bounded even when the backing collection is large.

Live backend tests

Integration tests are skipped unless their backend endpoint is configured:

Driver Environment variables
Typesense RETRIEVAL_TYPESENSE_URL, optional RETRIEVAL_TYPESENSE_API_KEY
Meilisearch RETRIEVAL_MEILISEARCH_URL, optional RETRIEVAL_MEILISEARCH_API_KEY
Weaviate RETRIEVAL_WEAVIATE_URL, optional RETRIEVAL_WEAVIATE_API_KEY
Milvus RETRIEVAL_MILVUS_URL, optional RETRIEVAL_MILVUS_TOKEN

Each live test owns a randomly named collection or index and exercises explicit setup, replacement, filtered query, projection, fetch, deletion, clear, and drop. Scan is additionally exercised where the driver advertises it.


All versions of instructor-retrieval with dependencies

PHP Build Version
Package Version
Requires php Version ^8.3
cognesy/instructor-events Version ^2.14
cognesy/instructor-http-client Version ^2.14
cognesy/instructor-polyglot Version ^2.14
cognesy/instructor-telemetry Version ^2.14
cognesy/instructor-utils Version ^2.14
cognesy/logging Version ^2.3
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 cognesy/instructor-retrieval contains the following files

Loading the files please wait ...