Skip to content
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

docs: add role and tools to getting started cli experience #211

Closed
wants to merge 1 commit into from

Conversation

psschwei
Copy link
Contributor

@psschwei psschwei commented Dec 2, 2024

Signed-off-by: Paul S. Schweigert [email protected]

Which issue(s) does this pull-request address?

Closes: #148

Description

We have found that bees perform best when:

  • they use fewer number of tools, and
  • they are provided explicit instructions/role

Here we updated the getting started section of the README to incorporate those recommendations into the simple example. We update the system prompt to provide explicit instructions, and we remove the search tool as it isn't needed for weather-related queries. It also adds some tips related to these two points to the appropriate section.

Additionally, it adds a yarn helper method to run the simple example: yarn run quickstart

Checklist

  • I have read the contributor guide
  • Linting passes: yarn lint or yarn lint:fix
  • Formatting is applied: yarn format or yarn format:fix
  • Unit tests pass: yarn test:unit
  • E2E tests pass: yarn test:e2e
  • Tests are included
  • Documentation is changed or added
  • Commit messages and PR title follow conventional commits

no tests included as this is a documentation change

@psschwei psschwei requested a review from a team as a code owner December 2, 2024 22:31
@psschwei
Copy link
Contributor Author

psschwei commented Dec 2, 2024

FYI @mmurad2 - if this wasn't what you were envisioning let me know, happy to iterate on this

@psschwei
Copy link
Contributor Author

psschwei commented Dec 2, 2024

this is a new one 😄

image

image

(source)

Signed-off-by: Paul S. Schweigert <[email protected]>

Fixes i-am-bee#148

We have found that bees perform best when:
* they use fewer number of tools, and
* they are provided explicit instructions/role

Here we updated the getting started section of the README to
incorporate those recommendations into the simple example. We update
the system prompt to provide explicit instructions, and we remove the
search tool as it isn't needed for weather-related queries. It also
adds some tips related to these two points to the appropriate section.

Additionally, it adds a yarn helper method to run the simple example:
`yarn run quickstart`

Signed-off-by: Paul S. Schweigert <[email protected]>
Copy link
Contributor

@Tomas2D Tomas2D left a comment

Choose a reason for hiding this comment

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

I think the issue was about adding role and tools to the CLI.
So, when someone starts the script, it first asks for tools and a role, and then the chat begins.


➡️ you can run this example after local installation, using the command `yarn start examples/agents/simple.ts`
➡️ you can run this example after local installation, using the command `yarn run quickstart`
Copy link
Contributor

Choose a reason for hiding this comment

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

run is not needed

@@ -86,6 +101,8 @@ console.log(`Agent 🤖 : `, response.result.text);
>
> Documentation is available at https://i-am-bee.github.io/bee-agent-framework/

➡️ See a more [advanced example](/examples/agents/bee.ts)
Copy link
Contributor

Choose a reason for hiding this comment

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

Missing . at the end.

Comment on lines +63 to +72
tools: [new OpenMeteoTool()], // for more explore 'bee-agent-framework/tools'
templates: {
system: BeeSystemPrompt.fork((old) => ({
...old,
defaults: {
instructions:
"You are a helpful assistant that uses tools to answer weather-related questions.",
},
})),
},
Copy link
Contributor

Choose a reason for hiding this comment

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

This definitely should not be part of README. Keep the example as is.

@psschwei
Copy link
Contributor Author

psschwei commented Dec 3, 2024

I think the issue was about adding role and tools to the CLI.
So, when someone starts the script, it first asks for tools and a role, and then the chat begins.

Ok, I think I misunderstood the ask here.

Do we currently have a way to create an agent from the command line? I believe all the examples I saw here are running an existing source code file (e.g. yarn start examples/agents/bee.ts) which already have tools and instructions predefined. So I'd assume we'd need to edit the source code files to add the tools / role prior to running the file? Or is there another approach that I'm missing?

Would there be a way to use the API here? That seems like the ideal way to add this kind of functionality, but I'm assuming that would need the whole stack and not just the framework, so might not be an option here...

@Tomas2D
Copy link
Contributor

Tomas2D commented Dec 3, 2024

Why would you use an API in the framework? API is built on top of the framework.
Just ask the user to specify a role, and if one is not provided then fallback to the default.

Maybe consult details in the related issue.

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.

Improve CLI getting started experience with Bee by customizing to a use case
2 participants