ExcelAgentTemplate is a powerful add-in that combines Microsoft Excel with Python. This tool enables users to leverage the latest LLMs (Large Language Models) through Excel functions and execute automated agents. By simply entering specific prompts in Excel cells, users can easily perform complex queries and data processing tasks utilizing LLMs.
For example, using the function =RunAgent("Act as a corporate information researcher. Please find the location of " & A1 & ".")
, the add-in automatically investigates the location of the company name entered in cell A1 and directly displays the result in Excel. This eliminates the need for manual data searches and input, allowing for efficient work progress.
ExcelAgentTemplate offers the following features:
- Intuitive Operation: LLMs can be directly invoked as Excel functions, requiring no special programming knowledge.
- Advanced Automation: Complex data collection and processing are automated, significantly streamlining workflows.
- Customizable: Agent behavior can be customized according to specific needs using Python scripts.
- Real-time Processing: Asynchronous processing enables fast handling of large amounts of data, reflecting results in real-time.
A | B | C | |
---|---|---|---|
1 | Company Name | Number of Employees - Research Report | Number of Employees |
2 | Example | =RunAgent("Research the number of employees for the company " & A2) |
=RunAgent("Please extract the number of employees from the following text. Report only the resulting numeric value: " & B2) |
ExcelAgentTemplate is particularly well-suited for the following purposes:
- Automating Checklist Verification: Ideal for checking and correcting inputs based on numerous checklists.
- Data Collection and Analysis: Automates the extraction and analysis of necessary information from large datasets.
- Report Generation: Simplifies the process of gathering information from multiple data sources, formatting it, and creating reports.
- Prototyping LLM Products: Suitable for prototyping and refining products that utilize language models.
- Translation: Well-suited for translation tasks using LLMs, especially when combined with human post-editing.
- Install Python 3.10 or higher
- Execute the following in the command prompt:
pip install uv uv venv .venv .venv\Scripts\activate uv pip install -r requirements.txt
- Rename
.env.example
to.env
and set the required API keys
- Install Microsoft Excel (2019 or later)
- Open RunAgentClient.sln in Visual Studio 2019 or later and build the solution.
- After the build, RunAgentClient/bin/Debug/RunAgentClient-AddIn64.xll will be generated. Double-clicking this file will temporarily enable the Excel add-in.
- Activate the virtual environment (
.\.venv\Scripts\activate
) and then runpython langchain_fastapi.py
- Double-click
RunAgentClient/bin/Debug/RunAgentClient-AddIn64.xll
. - A notification screen stating "There are no usable digital signatures" will be displayed. Click "Enable this add-in for this session only (E)". The
RunAgent
function will be available only for this session. - Create a new blank workbook in that session.
- In any cell, enter a formula like
=RunAgent("Please research the number of employees for XYZ Corporation.")
, replacing "XYZ Corporation" with an appropriate company name, and press Enter. #N/A
will be displayed. On the Python screen, logs indicating the processing status will be shown. Once the processing is complete, the cell content will be replaced with the actual output.
- Keep track of your OpenAI API usage.
- This tool does not use a GPU.
Q. What tasks is ExcelAgentTemplate suitable for? A. ExcelAgentTemplate is well-suited for automating various business tasks such as data collection, analysis, and report generation. It is particularly effective for non-standard tasks and situations that require integration with external data.
Q. How can I add new agents? A. Please refer to the following:
- Publish an API endpoint that implements the agent. It is recommended to use a caching mechanism for cases where the same message is input.
- The Excel add-in is created using Excel-DNA. Since LLM outputs can take some time, ensure that you perform asynchronous processing as shown in the sample code.
- For web searches, Tavily is used instead of directly using SerpAPI. Tavily seems to be more compatible with LLMs compared to raw Google searches, DuckDuckGo, or Bing.
If you have any other questions, feel free to ask on the GitHub Issues or the Discord server.
Discussions and information exchanges related to the project are conducted on the following Discord server:
Feel free to join!
The ExcelAgentTemplate project plans to add the following features:
- Support for Local LLMs
- Enhancement of documentation
If you have any requests or ideas, please let us know by creating an Issue.
This project is released under the MIT License. Please refer to the LICENSE file for details.
Contributions to the project are welcome. If you have any bug reports or suggestions for additional features, please create an Issue. Pull Requests are also accepted at any time.