Chat with datasources
With Superagent you can easily create an AI Assistant that has access to your private data through a concept we call Datasources
.
Superagent supports different types of datasources listed here. Attaching a datasource to an Assistant enables that Assistant to read and analyze that data.
Step-by-step guide
Note that you usually only need to create the llm
object once and re-use it for subsequent agents you create.
- Start by configuring an LLM and creating an agent
- Now let’s create a datasource by uploading Tesla’s Q3 2023 Earnings report to Superagent. Note that the
description
key tells the Assistant when this datasource should be used. Be vary of what you put in as your description as it might effect the Assistant’s behaviour.
- Now we can start chatting with the Assistant:
That’s it! You can attach one or many datasources to your Assistants by following the same pattern. Be aware that there might be some rate limiting when adding many big datasources at once.
Full code
Replit template
We’ve created a Replit template for this which you can run here.