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 1 commit 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?

@@ -507,6 +517,7 @@ private function processStoreConfig(string $type, array $stores, ContainerBuilde
->setArguments($arguments);

$container->setDefinition('ai.store.'.$type.'.'.$name, $definition);
$container->registerAliasForArgument('ai.store.'.$name, StoreInterface::class, (new Target($name.'Store'))->getParsedName());
Copy link
Member

Choose a reason for hiding this comment

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

ah okay, that was unexpected as well 😆

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Well, yes, I'm tired of using #[Autowire] attribute when injection stores so, here's the solution 😄

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I can move this part to another PR if it's an issue here, that's not a big deal.

@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

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