Broadly speaking, the future of getting things done with our new magical AI APIs are “Agents.” The definition varies, but I think the folks at Anthropic did a great job on the blog post Building effective agents.
I wanted to try out two appraoches.
- Workflow: a flowchart of decisions and tool calls to answer a prompt from the user. It commonly will have steps to determine which tools to use and evaluate the results.
- Agent: an LLM (like OpenAI) is given a prompt from the user and a set of tool definitions and decides how to use them to answer the prompt.
In this app, I made it easy to try out both to talk to Salesforce data (fake data checked into a duckdb database in this repo).
To get started with this example, follow these steps:
- Ensure you have Python and Poetry installed on your system.
- Clone the repository and navigate to this directory.
poetry env use 3.10.15
- Install the required dependencies by running
poetry install
. - Set your OpenAI API key as an environment variable:
cp .env.example .env
and add your key to.env
. - Download the embedding model:
poetry run download_embedding_model
- Run the application:
./dev.sh
. - Open http://localhost:8080/chat
poetry run pytest -s app/tests
Read more about this on the blog post here