April 26, 2023, 12:49 p.m. | Lars Grammel

DEV Community dev.to

In this tutorial, you'll learn how to create an agent that answers questions by searching and reading Wikipedia articles using JS Agent. You can find the complete code in the Wikipedia agent example.


This is the high-level flow of the agent:


The agent will use the following components:



  • OpenAI gpt-3.5-turbo chat completion model

  • A loop in which the agent determines and executes steps ("GenerateNextStepLoop")

  • A custom prompt

  • Wikipedia search tool (implemented using a Programmable Search Engine)

  • Wikipedia …

ai article articles beginners chat code command line components example flow gpt gpt-3 gpt3 gpt-3.5 javascript learn line loop openai openai gpt openai gpt-3 prompt questions reading search search engine searching shows tool tutorial wikipedia

ML/AI Engineer / NLP Expert - Custom LLM Development (x/f/m)

@ HelloBetter | Remote

Doctoral Researcher (m/f/div) in Automated Processing of Bioimages

@ Leibniz Institute for Natural Product Research and Infection Biology (Leibniz-HKI) | Jena

Seeking Developers and Engineers for AI T-Shirt Generator Project

@ Chevon Hicks | Remote

Security Data Engineer

@ ASML | Veldhoven, Building 08, Netherlands

Data Engineer

@ Parsons Corporation | Pune - Business Bay

Data Engineer

@ Parsons Corporation | Bengaluru, Velankani Tech Park