LLM powered Research assistant
Table of Contents
How to build a research assistant powered by LLM. Natural Language Processing (NLP) has been a hot topic in the field of Artificial Intelligence (AI) for the past few years. The advancement in transformer models has made it easier to build powerful NLP models. Furthermore, better hardware and software tools have made it easier to take advantage of these models for much broader applications. In this article, I explore the pros and cons of LLM agents, different design architectures, and how to build a research assistant powered by LLM. In this article, the core concept is to evaluate the potential of using LLM as a cog in the wheel of automation. Web crawling, data extraction, and summarization are some of the tasks that was traditionally hard to automate due to the complexity of the natural language. Meanwhile, the world wide web in this era is crowded with misinformation and biased information. Considering the fact that manual web surfing is time consuming and error prone, it is imperative to automate the process of information extraction and summarization. There is no shortage of research on NLP and LLM. The most popular LLM models are GPT-4o, ollama, Claude 3.5 Sonnet, and Gemini. The founders of these models have published numerous papers and articles on the topic. The said companies are mainly focused on on improving the and expanding the LLM models or building frameworks and tools to make it easier to build applications on top of these models. An LLM by itself can not achieve much. To improve it for the purpose of automation, we can make use of a framework that can help us to build a research assistant. The research assistant should be able to crawl the web, extract information, summarize it, and present it in a readable format. The research assistant should also be able to answer questions based on the information it has extracted. The research assistant is built using Python. The core libraries used are Langgraph, and the libraries in its ecosystem. There are many different ways to design the architecture of the research assistant. The most powerful and flexible way is to use a graph based framework for Chain-of-Thought (CoT) reasoning. A Retrieval-Augmented generation to enhance the generation of the text with more reliable information. Tool-use Agents to provide the tools for an adaptive agent to use. And a Memory-Augmented Transformer to store the information for future use. The two main design architectures that i exprimented with and found to be effective are: __start__ __end__ __start__ __end__ The information that flow through the graph is represented as a state and can hold many different key values. The system and human prompt for each agent should be clear and concise. Additionall information can be formatted dynamically to the prompt. It’s also noteworthy that with cerful prompt design, the agent can be used to return information used for conditional logic. The next key step is to define the tools and binding them to the agent. Finally, the Evaluation an output of LLM, normally done with a set of predefined inputs and outputs. The generated output is compared with the expected output. Comparing is done using a cosine similarity or ROUGE score. However, for task such as this that, the output can widely vary, I did not possess a predefined output. Instead, I used a pairwise evaluation technique to compare the output of this model, a The results showed a significant improvement over the The research assistant powered by LLM is a powerful tool that can be used to automate the process of information extraction and summarization. The research assistant can crawl the web, extract information, summarize it, and present it in a readable format. This may enhance the lives of people who depend on information on the web. But, this is not the only use case of the agentic models. This can help automate systems that previously required human labor for a small portion of the flow. This system can introduce automation to the systems that where not possible before, i.e. self-correcting systems that required chain of thought reasoning. Abstract
Introduction
Related Works
Problem Statement
Materials and Methods
Concepts and Glossary
Design Architecture
graph TD;
__start__([
graph TD;
__start__([ Implementation
: = # Report topic
: = # Search query
: =
: =
: = # Research loop count
: = # Final report
"""
here is the previous chat history:
{chat_history}
"""
=
=
StateGraph class is used to define the flow of information. by binding the nodes and edges to the agent.
=
# Add edges
Evaluation
llama-3.2-70b and GPT-4o. The judgement was based on the quality of the summary, the relevance of the information, and the readability of the summary. The Judge was a GPT-4o model.llama-3.2-70b. However, In all the tests, the GPT-4o model outperformed the research assistant. Conclusion