Skip to content

[Store] Add commands to setup/drop a store #335

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 8 commits into
base: main
Choose a base branch
from

Conversation

Guikingone
Copy link
Contributor

Q A
Bug fix? no
New feature? yes
Docs? yes
Issues #330
License MIT

Hi 👋🏻

As discussed in #330, here's the commands required to setup/drop the stores, by default, I moved the commands in the Store component but wasn't sure about it.

@carsonbot carsonbot added Status: Needs Review Feature New feature Store Issues & PRs about the AI Store component labels Aug 20, 2025
@carsonbot carsonbot changed the title [Store]: ManagedStoreInterface commands added [Store] : ManagedStoreInterface commands added Aug 20, 2025
@Guikingone Guikingone changed the title [Store] : ManagedStoreInterface commands added [Store] ManagedStoreInterface commands added Aug 20, 2025
@OskarStark OskarStark changed the title [Store] ManagedStoreInterface commands added [Store] Add commands to setup/drop a store Aug 20, 2025
@Guikingone Guikingone force-pushed the store/commands branch 2 times, most recently from 1ef933d to 30c5f2f Compare August 20, 2025 15:03
$stores = array_keys($builder->findTaggedServiceIds('ai.store'));
if (1 === \count($stores)) {
$builder->setAlias(StoreInterface::class, reset($stores));
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

unexpected to see this being removed - was it intentional?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, as the aliases are defined for each store, I'm not sure if we need this alias anymore 🤔

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

please revert this, see #355

It should still be possible to just use StoreInterface $store if only store is configured - which is basically quite common, i'd say

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

BTW, regarding #355, as I brought the issue, do you want me to work on the fix?

@chr-hertel
Copy link
Member

I moved the commands in the Store component but wasn't sure about it.

no no, that the right decision from my point of view 👍

@chr-hertel
Copy link
Member

Alright, let's talk about functional testing here - that's important to me with that amount of bridges we can't go with manual.

My first idea was to bring in simple store examples, that would setup, add, query and drop. but that would be super similar to the rag ones - well without the agent tho.
so a) we adopt be commands in those examples, b) we bring in new one with only those for operations, and c) $yourIdea 🤷‍♂️ 😆

@Guikingone
Copy link
Contributor Author

What about improving the rag examples by adding the drop calls when it's possible?

Maybe just before returning the content to the user?

Don't know if adding examples with commands brings any benefits to the user or we're talking about single-file commands that we can call in the existing examples 🤔

@OskarStark
Copy link
Contributor

I would keep the examples, but what about using setup and store in CI to see if they are working? Could be a follow up PR imho

@OskarStark
Copy link
Contributor

Docs are missing

@Guikingone Guikingone force-pushed the store/commands branch 2 times, most recently from 853094b to c1bcf91 Compare August 22, 2025 11:41
@chr-hertel
Copy link
Member

If we could shift it to GitHub actions, that would be fine as well - and it's true, that there is little benefit to users with examples only setup-add-query-drop, true.

We already skipped it in #328 - so we should bring it in now.

@Guikingone Guikingone force-pushed the store/commands branch 3 times, most recently from f00ae61 to bdd97ab Compare August 25, 2025 14:16
@Guikingone
Copy link
Contributor Author

I was wondering, shouldn't we use the demo in actions to show how to use the commands?

We can build a container then make the commands accessible but we already have the demo project with configuration, maybe we can improve it and use it as a "functional" test in CI? 🤔

SYMFONY_REQUIRE: ${{ matrix.symfony-version || '>=6.4' }}

steps:
- uses: actions/checkout@v4
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
- uses: actions/checkout@v4
- uses: actions/checkout@v5

@chr-hertel
Copy link
Member

I was wondering, shouldn't we use the demo in actions to show how to use the commands?

We can build a container then make the commands accessible but we already have the demo project with configuration, maybe we can improve it and use it as a "functional" test in CI? 🤔

The demo currently has only one store - and I like that simplicity there. But I get your point.

So I see two options, test the functional integration only on service level with a PHPUnit testcase neglecting the command level, or bring in a small example script with bootstrapping a console application and registering the commands there. i'm not sure we need a separate container image but go with the setup-php base. but maybe i'm missing something here.

@Guikingone
Copy link
Contributor Author

Let's add a small console + commands then 👍🏻

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Feature New feature Status: Needs Review Store Issues & PRs about the AI Store component
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants