Skip to main content

Building an Agent for Tabular Data

As a simple entry point tutorial, we will create an agent that can answer questions from tabular data.

We start with creating a component to upload files, which is the end-point for entering the specific CSV file used in this example (list of films and their ratings).

Lunar Workflow

We then connect the CSV component to a Python Coder component, which gets the serialized content of the file, with the associated attributes and values.

Lunar Workflow

We name this Python coder component ‘Read file content’.

Lunar Workflow

With access to the content in hand, we add an LLM component (in this case, a specific Azure API component, but any LLM will do), where we can specify a query prompt. Here one could define a prompt with free queries, however, to exemplify the notion of input variables in Lunar (here {imdb data} and {movie}), we link the output of the previous component as a part of the context creation process.

Lunar Workflow

You are now ready to run your workflow:

Lunar Workflow

Where you can see the output at the bottom of the component.

Lunar Workflow