Download the PHP package builtbyberry/laravel-swarm-memory-vector without Composer

On this page you can find all versions of the php package builtbyberry/laravel-swarm-memory-vector. 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 laravel-swarm-memory-vector

Laravel Swarm Memory Vector

Vector-backed semantic recall for Laravel Swarm memory. This companion package implements the core MemoryStore contract, transparently embedding every memory write and letting agents recall memory by meaning — "what did we learn about the rocket?" — instead of by exact key. Semantic search runs natively on PostgreSQL with pgvector, with a portable fallback that works on any database.

Semantic search is a ranking layer, never a leak. The vector reader only ever ranks the exact set of entries the active swarm's propagation policy already permits an agent to see. A vector hit can never surface memory that the standard recall tool would withhold.

Requirements

Version 0.2.0 adopts Laravel AI 1.x and core 0.27. Applications on older core/AI lines must stay on a compatible 0.1.x companion release until they upgrade both. See UPGRADING.md. The embedding API remains text-only. Version 0.3.0 additionally admits core ^0.28 (native Laravel AI feature access) on the same AI 1.x line, with no dependency break.

The v0.2.0 compatibility work was validated against the exact core 0.27 candidate with minimum/current official AI 1.x on PHP 8.4/8.5 scan and PHP 8.4 real PostgreSQL/pgvector; v0.3.0 adds the same minimum/current scan and pgvector lanes against the frozen core 0.28 candidate 269f749. Candidate checks used temporary CI metadata and are historical prepublication evidence. A fresh Packagist-only consumer installation remains a separate shipping gate. See the compatibility evidence.

Installation

Publish the config and run the migration:

The migration creates a swarm_memory_vectors table. On PostgreSQL it enables the vector extension and creates a native vector(N) column with an HNSW cosine index; on any other database it stores embeddings as JSON for the portable scan driver.

Configure an embedding provider

Embeddings are generated through Laravel AI. Point it at your embedding provider of choice — for example Voyage AI:

SWARM_MEMORY_VECTOR_DIMENSIONS must match the vector width your provider/model returns — it fixes the width of the vector(N) column. Voyage's voyage-4 returns 1024; OpenAI's text-embedding-3-small returns 1536. A mismatch fails loudly rather than corrupting the index.

Laravel AI's HTTP-backed providers do not require an additional provider SDK. Bedrock requires the optional aws/aws-sdk-php package; selecting Bedrock without it gives installation guidance. Follow the installed Laravel AI package's optional-dependency constraints and use a supported, security-patched SDK release. This companion does not require AWS SDK or Laravel MCP. Native HTTP-wire tests cover OpenAI and Voyage; they do not establish AWS transport compatibility.

How it works

Once installed, the package rebinds the Swarm MemoryStore to a decorator around the core database store:

Non-string values (arrays, numbers, booleans) are persisted normally but not embedded — they remain fully available through the exact-key recall tool.

Semantic recall in an agent

Scaffold a vector-aware memory tool with the core generator (it detects this companion via Composer):

Wire the generated tool's semanticRecall() to this package's reader:

Drop the tool into any laravel/ai agent's tools() array. When the model calls it with a free-text query, it gets back the most semantically similar memory entries, formatted exactly like the core recall tool (key: value, one per line). The scope id is resolved from the active run — never accepted from the model.

Configuration

All keys live in config/swarm-memory-vector.php:

Key Env Default Purpose
enabled SWARM_MEMORY_VECTOR_ENABLED true Rebind the memory store to the vector-backed decorator.
connection SWARM_MEMORY_VECTOR_CONNECTION default Connection holding the vector table (must match the memory connection).
driver SWARM_MEMORY_VECTOR_DRIVER auto pgvector, scan, or null to auto-detect (pgvector on pgsql).
table SWARM_MEMORY_VECTOR_TABLE swarm_memory_vectors The embedding table.
embedding.provider SWARM_MEMORY_VECTOR_PROVIDER Laravel AI default Embedding provider.
embedding.model SWARM_MEMORY_VECTOR_MODEL provider default Embedding model.
embedding.dimensions SWARM_MEMORY_VECTOR_DIMENSIONS 1024 Vector width; must match the provider/model.
search.default_limit SWARM_MEMORY_VECTOR_LIMIT 5 Results returned when the caller omits a limit.
search.min_similarity SWARM_MEMORY_VECTOR_MIN_SIMILARITY null Drop hits below this cosine score.
on_embedding_failure SWARM_MEMORY_VECTOR_ON_EMBEDDING_FAILURE store_without_vector store_without_vector keeps memory durable when embedding fails; throw aborts the write.

Drivers

Testing

The suite runs against sqlite (scan driver) locally and additionally against a real pgvector-enabled PostgreSQL in CI.

License

MIT © Daniel Berry / Built by Berry


All versions of laravel-swarm-memory-vector with dependencies

PHP Build Version
Package Version
Requires php Version ^8.4
builtbyberry/laravel-swarm Version ^0.27 || ^0.28
illuminate/console Version ^13.0
illuminate/contracts Version ^13.0
illuminate/database Version ^13.0
illuminate/support Version ^13.0
laravel/ai Version ^1.0
spatie/laravel-package-tools Version ^1.16
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 builtbyberry/laravel-swarm-memory-vector contains the following files

Loading the files please wait ...