Datasources
Dash Agents provide you an easy to way to specify various data sources, which are automatically indexed and can be used in the commands during task execution
Feature | Ideal Data Source |
---|---|
Answer user queries | Official documentation, existing blogs |
Generate specific code | Code samples, templates |
Debug Problems | Github Issues |
Creating a DataSource
To add a data source in Dash Agent, you need to create a class that extends the DataSource
abstract class. The DataSource
class provides three getters: projectObjects
, fileObjects
, and webObjects
, which allow you to specify the data sources for your agent.
1. WebDataObject
Use this to index your web documentation, blogs (open and scrappable), and even github repositories and issues.
2. FileDataObject
Use this to index your local codebases, private content and specialized content created to assist agents.
Note: Only text based files like text, markdown, code etc is supported. PDFs or images and videos will not be indexed.
3. ProjectDataObject
Provide locally created content from within the agent project.
Once you have defined your data sources using the appropriate getters, you can use them in your process steps to find relevant documents.
MatchDocumentStep
To find most relevant documents (top 3-5) from the entire data sources, you can use the MatchDocumentStep
in your process steps.
Example usage:
query
: Query built by string interpolating user inputs or previous step outputs.dataSoures
: List of data sources to search across.output
: To be used in the next steps likePromptQuery
or for other processing.
By leveraging data sources and the MatchDocumentStep
, you can easily find relevant documents from your entire data sources and use them in your Dash Agent's processing pipeline.