Repository navigation
Releases
Releases · skybleak333/hindsight-php
v0.3.0: Guzzle 8 and a Laravel Boost skill
Added
- A Laravel Boost guideline and the
hindsight-php-agent-memoryagent skill.php artisan boost:installoffers them under third-party packages (checked with Boost 2.10.4).
Fixed
- The package can be installed in a new Laravel 13 application: it allows Guzzle 8, which Laravel 13.40 installs by default. Before, Composer refused
fedoseev/hindsight-phpthere unless Guzzle was downgraded. CI now runs on Guzzle 8 and keeps a Guzzle 7 job.
v0.2.0: queued retains and Hindsight::fake()
Agent memory that waits out an outage of the Hindsight API, and memory you can test without a server.
// Store each exchange from a queue worker, with retries that never store it twice.
Memory::bank("user-{$this->user->id}")->queue();
// In tests
Hindsight::fake(['user-1' => ['Alice is on the Pro plan']]);
Hindsight::assertRetained('user-1', fn (string $content) => str_contains($content, 'renews'));Tested in CI on PHP 8.2–8.5, Laravel 12 and 13, Laravel AI SDK 1.0 and 1.3, and real Hindsight 1.1.0 and 1.2.0 servers.
Added
Hindsight::fake()andFedoseev\Hindsight\Testing\HindsightFake: an in-memory server for tests, withassertRetained(),assertNotRetained(),assertNothingRetained(),assertRecalled(),assertNotRecalled()andassertReflected(). It follows the server where tests depend on it: a bank nobody wrote to answers 404, tag filters select the same memories, a retain with a document ID replaces the document, an async retain repeated with the same operation ID stores nothing new, and invalid operation IDs, timestamps, tags, metadata values and update modes are rejected with the server's status.unavailable()simulates an outage,respondTo()stubs other endpoints.RetainMemoryjob andMemory::queue(): store memories from a queue worker, retried with backoff while the Hindsight API is unavailable (six attempts over about 36 minutes by default; earlier attempts log a warning, only a failure on the last attempt is reported). Every attempt sends the operation ID the job got when it was dispatched, so a retry never stores a memory twice, and the dispatch time as the memory's timestamp. Errors a retry cannot fix fail the job at once and are reported.queuesection inconfig/hindsight.php: connection, queue, tries, backoff and payload encryption.- Bank aliases:
listBankAliases(),addBankAlias(),setPrimaryBankAlias()andremoveBankAlias(), on the client and the facade. retryOperation()to queue a failed or cancelled operation again.- CI also runs the integration suite against Hindsight 1.2.0, and compares the fake with real 1.1.0 and 1.2.0 servers.
Changed
Hindsightis no longerfinal, soHindsightFakecan stand in for it. Other subclasses are not supported.
v0.1.0
First release of a PHP client for Hindsight agent memory, with long-term memory for Laravel AI SDK agents.
Client
- Retain (single, batch, async), recall and reflect, plus banks, bank configuration, memories, documents, directives, mental models and operations.
request()reaches any other endpoint. waitForOperation()for async work, typed responses for the main calls, and one exception per failure mode.- Hindsight answers
200for parameters it does not know and names them in anX-Ignored-Paramsheader. The client turns that header into a warning for any PSR-3 logger, so a typo inoptionsdoes not change results without a sign.
Laravel
- Service provider, config, facade and
php artisan hindsight:status. Memoryagent middleware: recalls relevant memories before the first step, retains the exchange after the step that ends the run. Best effort by default, with a 10-second timeout, so a Hindsight outage never takes the agent down.Recall,RetainandReflecttools for agents that should decide for themselves.
Tested
- Every request in the unit tests is checked against Hindsight's OpenAPI 1.1.0 document, stricter than the server.
- CI runs the integration suite against a real Hindsight 1.1.0 server (no LLM, no API keys), on PHP 8.2–8.5, Laravel 12 and 13, Laravel AI SDK 1.0 and 1.3, and the lowest allowed dependencies.
This is a community package, not affiliated with Vectorize.