Repository navigation
hindsight-php: a PHP client, and memory for Laravel AI SDK agents #6445
skybleak333
started this conversation in
Show and tell
Replies: 1 comment
|
This is a really interesting community contribution!
Bringing Hindsight's memory capabilities to PHP and Laravel AI SDK is a
great step towards making persistent memory more accessible to developers
working across different technology stacks.
I particularly like the middleware approach, where the agent recalls
relevant context before responding and retains the conversation afterward.
I'm currently a first-year BTech student specializing in Computer Science
and Engineering (AI & ML), learning Python and exploring AI-powered
applications and open-source projects.
Although I'm still at the beginning of my development journey, projects
like this help me understand how memory systems, LLM integrations, and AI
agent architectures work in real-world applications.
Great initiative! Looking forward to seeing how this community package
evolves.
…On Sun, 8 Nov 2026, 20:24 Andrei Fedoseev, ***@***.***> wrote:
I use Hindsight as memory for my coding agents and work mostly in PHP.
There was no PHP client, so I wrote one: hindsight-php
<https://github.com/skybleak333/hindsight-php>.
It has two parts.
*A plain PHP client.* Retain, recall, reflect, banks and their config,
documents, directives, mental models and operations. Method names follow
the Python and TypeScript clients. If the server ignores a parameter, the
X-Ignored-Params header becomes a PSR-3 warning, so a typo doesn't
silently change results.
*Memory for Laravel AI SDK agents.* One middleware: before the agent
answers, it recalls what the bank knows about the user; after it answers,
it retains the exchange.
public function middleware(): array
{
return [Memory::bank("user-{$this->user->id}")->queue()];
}
With ->queue(), the retain runs as a queued job and retries while the API
is down. Every attempt sends the same operation_id, so a retry after a
lost response doesn't store the memory twice. I checked that on real 1.1.0
and 1.2.0 servers: the same retain twice without an ID gives two copies,
with an ID one.
Hindsight::fake() lets you test agents without a server. CI compares its
tag filters and rejected requests with real servers.
v0.3.0 also ships a Laravel Boost guideline and agent skill, which php
artisan boost:install offers.
It isn't on Packagist yet, so install from GitHub:
composer config repositories.hindsight-php vcs https://github.com/skybleak333/hindsight-php
composer require fedoseev/hindsight-php:^0.3
It's a community package, MIT, not affiliated with Vectorize. If you run
Hindsight from PHP, I'd like to hear what's missing.
—
Reply to this email directly, view it on GitHub
<#6445?email_source=notifications&email_token=CO23IZGDTN6ZO7VXMZCEJC35YCCLLA5CNFSNUABBM5UWIORPF5TWS5BNNB2WEL2ENFZWG5LTONUW63RPGEYTENJWGMYTFJTSMVQXG33OVJZXKYTTMNZGSYTFMSSWK5TFNZ2KYZTPN52GK4S7MNWGSY3L>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/CO23IZC7ALXIGYS4VZ62PQD5YCCLLAVCNFSNUABJKJSXA33TNF2G64TZHMYTAOBWGQYTSMBWGE5UI2LTMN2XG43JN5XDWMJRGI2TMMZRGKQXMAQ>
.
You are receiving this because you are subscribed to this thread.Message
ID: ***@***.***>
|
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
I use Hindsight as memory for my coding agents and work mostly in PHP. There was no PHP client, so I wrote one: hindsight-php.
It has two parts.
A plain PHP client. Retain, recall, reflect, banks and their config, documents, directives, mental models and operations. Method names follow the Python and TypeScript clients. If the server ignores a parameter, the
X-Ignored-Paramsheader becomes a PSR-3 warning, so a typo doesn't silently change results.Memory for Laravel AI SDK agents. One middleware: before the agent answers, it recalls what the bank knows about the user; after it answers, it retains the exchange.
With
->queue(), the retain runs as a queued job and retries while the API is down. Every attempt sends the sameoperation_id, so a retry after a lost response doesn't store the memory twice. I checked that on real 1.1.0 and 1.2.0 servers: the same retain twice without an ID gives two copies, with an ID one.Hindsight::fake()lets you test agents without a server. CI compares its tag filters and rejected requests with real servers.v0.3.0 also ships a Laravel Boost guideline and agent skill, which
php artisan boost:installoffers.It isn't on Packagist yet, so install from GitHub:
It's a community package, MIT, not affiliated with Vectorize. If you run Hindsight from PHP, I'd like to hear what's missing.
All reactions