Skip to content

Adds Neon as a tool for storing structured data #51

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

Merged
merged 8 commits into from
Nov 30, 2024

Conversation

davidgomes
Copy link
Contributor

@davidgomes davidgomes commented Nov 16, 2024

This PR adds Neon as a tool so that we can build agents that store structured data in ephemeral or long-lived Postgres instances.

This PR also augments the web_researcher example with a third task that uses an agent to store the data collected in the previous two tasks in Postgres.

I wasn't quite sure of whether to write the code in agentstack/templates/crewai/tools/neon_tool.py or just directly inside the example in examples/web_researcher/src/tools/neon_tool.py. This is because the mem0_tool.py code seems to be somewhat duplicated, so I'm not sure what the best way to go about this is. The comments in the code should explain my confusion.

There's this video too:
https://drive.google.com/file/d/1Tozsjwg8c2jW8fun5UpMKX8V3BVUzmDS/view?usp=sharing

(And yes, in the video, I interchangeably refer to AgentOps/AgentStack but I know they're different things. All of the observability comes from AgentOps and AgentStack is one framework for building agents ☺️ )

@davidgomes davidgomes changed the title Starts work on the Neon tool Adds Neon as a tool for storing structured data Nov 17, 2024
@bboynton97
Copy link
Contributor

hi @davidgomes! thank you for the contribution!!

so your confusion is because agentstack/templates/crewai/tools/neon_tool.py is the template file. once this code is in, you can run agentstack tools add neon while in the web_researcher directory, and agentstack will add the tool to the project.\

the code is duplicated in the sense that it is in this repo twice but to an agent developer that is building with agentstack, they would only have the code generated once in their project based on that template file.

we generate code instead of importing it from the agentstack package because in many of our tools, there is an expectation that a developer will make small changes to better fit their use-case

@davidgomes
Copy link
Contributor Author

hi @davidgomes! thank you for the contribution!!

so your confusion is because agentstack/templates/crewai/tools/neon_tool.py is the template file. once this code is in, you can run agentstack tools add neon while in the web_researcher directory, and agentstack will add the tool to the project.\

the code is duplicated in the sense that it is in this repo twice but to an agent developer that is building with agentstack, they would only have the code generated once in their project based on that template file.

we generate code instead of importing it from the agentstack package because in many of our tools, there is an expectation that a developer will make small changes to better fit their use-case

Gotcha! So, while developing, do you typically develop in the crewai directory and then actually using agentstack tools add neon to whichever example you're working off of?

@bboynton97
Copy link
Contributor

In my development process, I usually create a project with agentstack init, add the agents and tasks that test the use case for that tool, then build a tool manually in that test project. Once its performing as expected, I move the tool file to templates/crewai/<tool>_name.py, create the config in tools/<tool>.json and add it to the tool list at tools.json.

Once that is done, I delete the tool code from my example project and then run agentstack tools add <tool> and test the agent again to make sure its added as expected. Make sure you installed agentstack with pip install -e . to have your current changes!

@davidgomes
Copy link
Contributor Author

In my development process, I usually create a project with agentstack init, add the agents and tasks that test the use case for that tool, then build a tool manually in that test project. Once its performing as expected, I move the tool file to templates/crewai/<tool>_name.py, create the config in tools/<tool>.json and add it to the tool list at tools.json.

Once that is done, I delete the tool code from my example project and then run agentstack tools add <tool> and test the agent again to make sure its added as expected. Make sure you installed agentstack with pip install -e . to have your current changes!

Ah this is good to know, I basically did all of that except much more manually.

Please let me know if you have any more feedback on the PR!

@tcdent
Copy link
Collaborator

tcdent commented Nov 30, 2024

Couple minor notes, but this is fantastic, and the example worked out of the box!

Copy link
Collaborator

@tcdent tcdent left a comment

Choose a reason for hiding this comment

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

Just pushed those small adjustments; this is good to go.

Thank you @davidgomes for your contribution!

@bboynton97
Copy link
Contributor

example worked perfectly! i made one small change by removing the tool manually and re-adding it programmatically with agentstack tools add neon. the agentstack.json file in web_researcher was modified to show the tool having been added.

I messaged in Slack, but I would love to have docs added for this ins docs/tools/tool/neon.mdx and be sure to link to it from docs/tools/community.mdx in a new "Database" tool category.

I'm going to go ahead and merge this PR to simplify merging some other PRs without additional conflicts, so it'd be great to get the docs added in a different PR.

Great work @davidgomes and thank you for reviewing @tcdent!! I'm very glad to have Neon available as a tool!!

@bboynton97 bboynton97 merged commit 48252d1 into AgentOps-AI:main Nov 30, 2024
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants