# Agents

Agents utilize language models as reasoning engines to dynamically select actions based on context and goals, unlike hardcoded chains. By analyzing the current state and anticipating outcomes, agents make informed decisions on action sequences, offering flexibility and efficiency.

### CSVAgent

The CSVAgent function in LangChain is used to create a CSV agent by loading data into a pandas DataFrame and using a pandas agent.

#### Params

* **llm** – Language model to use for the agent.
* **path** – A string path, file-like object or a list of string paths/file-like objects that can be read in as pandas DataFrames with pd.read\_csv().

#### Examples

<figure><img src="/files/gEhX3rQZN6Ua5xlZmyR2" alt=""><figcaption></figcaption></figure>

To use the CSVAgent Component, the user is to provide the necessary CSV file through the path input. The component is also to be connected to an LLM component.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.aiplanet.com/genai-stack-1/components/agents.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
