Setting Up the Basic Structure for DeepResearcher
Introduction: Laying the Foundation for DeepResearcher
Welcome to the first lesson of the "Creating a Researcher in Python with OpenAI" course! In this course, you will learn how to build DeepResearcher, an AI-powered research tool that can search the web, gather information, and generate a final report — all using Python.
Before we dive into the details of web searching and AI, it’s important to set up a solid foundation. A clear project structure will help you keep your code organized, make it easier to add new features, and help you debug problems as you go. In this lesson, we’ll walk through the basic structure of the DeepResearcher project and explain how the main program is set up.
By the end of this lesson, you’ll understand how the main parts of the project fit together and be ready to start building out each piece in future lessons.
Recall: Project Flowchart
Let’s start with a quick reminder about how the DeepResearcher works:
This flowchart illustrates the step-by-step process, showing how each component fits into the overall workflow. The LLM (Language Model) and Web components work together to automate the research process.
Understanding the Main Program
Now, let’s look at the main file of our project: main.py. This file is the entry point for DeepResearcher. It’s where the program starts running.
Let’s break down the key parts of this file step by step.
1. Importing Functions
At the top of the file, we import a function from another part of our project:
This allows us to use the clear_visited_pages function in our main program.
