LeetTools Agent Workflow-Running a Customized Agent Workflow

Jul 9, 2024

Content

Share with:

Introduction

LeetTools enables the development of intelligent agents capable of dynamically executing complex workflows and making decisions based on the current state and available information. Agents utilize language models to strategically determine the sequence of actions to perform. By assigning different tasks to various agents in the form of workflows, such as intent recognition, question rewriting, and keyword searching, the time and labor required for manual operations are greatly reduced, enhancing the accuracy and consistency of the output results. It can also quickly interface with BI tools for visual presentation, achieving a complete process from the input of natural language, keywords, or commands to the visualization of data and information.

Through this customized process, we can generate a knowledge base and detailed reports that meet user expectations, compensating for the lack of deep analysis and generation in shallow search engines. This method not only improves the accuracy and relevance of information but also ensures the comprehensiveness and practicality of the generated content.

Agent Workflow Process

Users only need to provide a single command to trigger and automate the execution of preset workflows. This process greatly simplifies the steps of task execution, ensuring high efficiency and stability of the process. Workflows (Agent Workflow) can be customized according to different needs based on business scenarios, such as intelligent Q&A, research reports, and news summaries, making the system highly flexible and able to quickly adapt to new business needs and changes.

The general Agent Workflow Process is as follows:

  1. User Input and Keyword Extraction: The user input serves as the topic, and keywords are automatically obtained through specified prompts. This step is the starting point of the entire workflow, ensuring the accurate capture of user needs.

  2. Search Phrase Generation: Using the obtained keywords and topic, search phrases are automatically generated through specified prompts. These phrases are the foundation for web searches and help to accurately locate information.

  3. Utilization of Advanced Search Engines: Search phrases are queried using advanced search engines such as Google API or DuckDuckGo, expanding the source of information and ensuring the quality and diversity of the information obtained.

  4. Web Page Parsing and Link Extraction: Web pages from search results are parsed to extract links from the articles, excluding navigational links and focusing on content links, which serve as an entry point for further information mining.

  5. Link Aggregation and Ranking: The extracted links are aggregated and ranked according to their frequency of appearance, ensuring the relevance and authority of the links.

  6. Iterative Web Crawling: Repeat the above process until a preset number is reached. At the same time, keep a record of the crawled web pages to avoid duplication and ensure the comprehensiveness and novelty of the information.

  7. Customized Report Template: Design a report template that clearly outlines the expected content and structure of each section.

  8. Incremental Section Generation: Generate each section incrementally to avoid the loss of details that may occur with full-text sections. Search within the collected data and use the retrieved data as context to provide rich information input for each section.

  9. In-depth Analysis and Customized Workflow: To address the inability of search engines to perform in-depth analysis and generation, the agent workflow employs more complex and customized processes to ensure that the generated knowledge base and documents meet the user's in-depth needs.

  10. Knowledge Base Construction and Document Output: Ultimately, through this process, a knowledge base that meets user expectations is constructed, and detailed documents are produced. These documents are not only rich in content but also have a clear structure, providing users with in-depth insights and analysis.

The advantage of the Agent workflow lies in its highly customizable and user-oriented design, which can generate in-depth analytical reports and knowledge bases through simple operations and automated running of Agent Workflow, meeting users' needs for the depth and breadth of information.

Run a Customized Agent Workflow

The following text takes the operation of a customized Agent Workflow, the Shopping Agent Workflow, as an example to describe how, with LeetTools, high-quality output reports can be generated by simply inputting a Topic.

1. User Input (Topic)

Topic: Pet Birthday Party

2. Intention Identification

Identify the User's Intention, Determine the Type of Task

User Input: Pet Birthday Party
Intent Recognition: The user is looking to obtain information and related resources about a pet birthday party

3. Keywords and Search Phrases Generation

Utilize the large model to generate appropriate search queries based on prompts, rather than manually extracting keywords.

# Keyword Generation
Prompt: Generate two keywords related to "Pet Birthday Party".
Output: [Pet Birthday Cake, Pet Party Decorations]

# Search Phrase Generation
Prompt: Generate search phrases using the keywords "Pet Birthday Cake" and "Pet Party Decorations" related to "Pet Birthday Party".
Output:
- "Where to buy Pet Birthday Cake"
- "Best recipes for Pet Birthday Cake"
- "Affordable Pet Party Decorations"
- "Creative ideas for Pet Party Decorations"

4. Rewriting

Question Rewriting and Optimization,rework the question to enhance the accuracy of search or processing.

Original Question: What do I need for a pet birthday party?
Refined Question: What are the essential items for organizing a pet birthday party

5. Vector Search

Keyword Vector Search and Semantic Vector Search, followed by Web Page Parsing. Semantic search relies on accurate vector embeddings to achieve a deeper level of semantic understanding.

Keyword Vector Search

Extract Keywords: Pet Birthday, Party Supplies, Pet Cake, Decorations
Search Result:
- Pet Birthday Cake ideas
- Popular Party Decorations for Pets
- Essential Supplies for Pet Parties

Semantic Vector Search

Using semantic vector search technology to generate search phrases.

Search Result:
- How to organize a memorable pet birthday party
- Tips for buying the best pet birthday cake
- Creative decoration ideas for pet parties

6. Search and Rank

Parse the web pages from the search results to extract the links within the articles. Aggregate the links and rank them by the frequency of appearance; if the frequency is the same, then select randomly or based on the website's ranking. Repeat the search and parsing process until the preset number of web pages is reached.

# Web-wide Search
# Search Phrases:
- "Pet birthday party supplies"
- "Best pet birthday cake"
- "Pet party decoration ideas"
- "How to throw a pet birthday party"

# Search Result Ranking
# Sorted Results:
1. Best pet birthday cake ideas and recipes
2. Essential supplies for a successful pet birthday party
3. Creative decoration ideas for pet parties
4. How to organize a memorable pet birthday party

7. API Invocation and Text Proofreading

Invoke relevant APIs as needed to obtain specific business data or perform related operations:

API Invocation Examples:
- API for obtaining pet cake suppliers
- API for obtaining pet party decoration suppliers

Before generating each section, perform text proofreading to ensure the accuracy and fluency of the content, thereby enhancing precision.

校对后的文本:
- Tips for organizing a pet birthday party
- Best supplies for a successful pet party
- Creative ideas for pet party decorations

8. Output Generation

Each time a section is generated, retrieve relevant information from the collected data and use the retrieved data as contextual input. Generate content section by section according to the report template.

### Final Recommendation:

**********************
The final recommendation
**********************
- Pet Birthday Cake: $25 [8]
- Pet Birthday Hat: $12 [4]
- Pet Birthday Decorations: $15 [2]
- Pet Birthday Treats: $10 [3]
**********************
The Product Links
**********************
[2] https://www.target.com/c/birthday-party-supplies/dogs/-/N-5xt37Zna245
[3] https://www.target.com/c/dog-treats-supplies-pets/cake/-/N-f3xknZ4vrc1
[4] https://www.amazon.com/dog-party-hat/s?k=dog+party+hat
[8] https://okraandmolly.com/collections/dog-birthday-cake-collection


Start your journey today