Download the PHP package boehmmatthias/smartsearch without Composer

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

smart_search

Generic vector embedding, semantic search, and RAG (Retrieval-Augmented Generation) infrastructure for TYPO3.

PHP 8.4+ TYPO3 14 License

smart_search gives any TYPO3 extension the building blocks for semantic search and LLM-powered answers — without being tied to any specific data model or AI provider. Drop in the services, embed your content, and get back results ranked by meaning rather than keyword overlap.

Alpha state. SmartSearch is under active development. The API is functional but may change before 1.0. We'd love your feedback: open an issue.


Features


Requirements

Requirement Version
PHP 8.4+
TYPO3 14.x
Embedding server Any server exposing POST /embedding (default http://localhost:8080)
Generation server Any OpenAI-compatible chat completions server (default http://localhost:8081)

Ships with llama.cpp clients out of the box. Any other HTTP-based provider (Ollama, OpenAI, Azure OpenAI, …) works by implementing two small interfaces — see Custom Backend.


Installation

Activate the extension:

Run the database schema update in Admin Tools → Maintenance → Analyze Database Structure to create the tx_smartsearch_vector table.


Server Setup

The extension is provider-agnostic: any server that exposes POST /embedding and POST /v1/chat/completions (OpenAI-compatible) works. Update the URLs in Admin Tools → Settings → Extension Configuration → smart_search to point at your chosen backend.

Production

Point the two configuration URLs at your production inference server — a self-hosted llama.cpp, Ollama, or a hosted API like OpenAI. No bundled scripts are involved.

To use a provider that speaks a different API shape (e.g. OpenAI), implement the two interfaces — see Custom Backend.

Development (llama.sh helper)

The extension ships a llama.sh convenience script for local development only. It manages two llama-server processes, PID files, and log rotation using locally installed llama.cpp binaries.

Prerequisites

Requirement Notes
llama.cpp Install via brew install llama.cpp on macOS, or build from source with LLAMA_CURL=1.
llama-server on $PATH Verify: llama-server --version
~6 GB free disk space Models are cached in ~/.cache/huggingface after first download.
~4 GB RAM The generation model needs ~4 GB; the embedding model is much lighter.

Verify both servers are up:


Configuration

All settings are available under Admin Tools → Settings → Extension Configuration → smart_search.

Key Type Default Description
embeddingServerUrl string http://localhost:8080 Base URL of the llama-server embedding instance.
generationServerUrl string http://localhost:8081 Base URL of the llama-server chat completions instance.
generationMaxTokens integer 512 Maximum tokens allowed in a generated answer. Increase for longer, more detailed responses.
generationTimeout integer 300 HTTP timeout in seconds for generation requests. CPU inference is slow — increase if answers are cut off.
embeddingContextLength integer 6000 Maximum characters of text passed to the embedding server. Keep in sync with the model's --ctx-size (roughly 4 chars per token for typical prose).
ragTopK integer 5 Number of top-scoring documents retrieved and passed as context for RAG generation.
documentContextLength integer 800 Maximum characters of document content included per context block in RAG requests.
semanticThreshold float 0.30 Minimum cosine similarity score (0.0–1.0) to treat a result as a semantic match. Results below this threshold can be filtered by the consuming extension.

Usage

Inject the services via constructor injection — TYPO3's dependency injection container wires everything automatically.

Storing and updating embeddings

Call VectorService::embedAndStore() whenever content is created or updated. Pass a collection name (a string that scopes your entries), a stable identifier, and the plain text to embed. Strip HTML before calling.

The call is idempotent — if the text has not changed since the last call, the embedding server is not contacted and the database is not written to.

Semantic search

RAG generation (full example)

Removing vectors

Remove individual vectors when records are deleted, or wipe an entire collection before a full reindex:

Checking server availability

Use ModelAvailabilityService to guard features that depend on the llama servers, for example to show or hide a semantic search toggle in the UI:

Results are cached for the duration of the current request (null-coalescing pattern).


Implementing a Custom Backend

The two interfaces make it straightforward to replace the llama.cpp clients with any other embedding or generation provider.

Custom embedding client (example: OpenAI)

Then bind it in your extension's Configuration/Services.yaml:

The same pattern applies to GenerationClientInterface for swapping the chat completion backend.

Note: When using a different embedding model, make sure all vectors in a collection were generated by the same model. Mixing models produces meaningless similarity scores. Use VectorRepository::deleteByCollection() and re-embed when switching models.


Troubleshooting

Search returns empty results

  1. Check that the embedding server is running: curl -s http://localhost:8080/health
  2. Confirm that embedAndStore() was called for your records.
  3. Query the database directly: SELECT COUNT(*) FROM tx_smartsearch_vector WHERE collection = 'your-collection';
  4. Lower semanticThreshold temporarily to 0.0 to see all results regardless of score.

Health check fails / server unavailable

Generated answers are cut off

Generation is very slow

Results have low relevance / wrong ranking

Dimension mismatch warning in logs

You switched embedding models without re-indexing. Entries generated by the old model have a different vector dimension than the query vector and are automatically skipped. Run a full reindex:


Known Limitations


Database Schema

Multiple extensions can share the table without collision by using distinct collection names (e.g. news-articles, faq-entries, product-descriptions).


Contributing

  1. Fork the repository and create a branch.
  2. Install dependencies: composer install
  3. Run the test suite: vendor/bin/phpunit packages/smart-search/Tests/Unit/
  4. Run static analysis: vendor/bin/phpstan analyse -c packages/smart-search/phpstan.neon
  5. Submit a pull request with a clear description of the change.

Please follow the existing code style (strict types, readonly constructors, PSR-12).


Testing

Changelog

See CHANGELOG.md.


All versions of smartsearch with dependencies

PHP Build Version
Package Version
Requires php Version ^8.4
typo3/cms-core Version ^14
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 boehmmatthias/smartsearch contains the following files

Loading the files please wait ...