Coder Social home page Coder Social logo

ai-agents-js's Introduction

Prompt Engineer and the AI Agents in Javascript

Prompts in a language model are like magic spells. You tell the model what you want to talk about or ask, and it generates a magical response based on the input. AI agents are like the wizard who consults their spell book to cast a series of spells. AI Agents use a large language model (LLM) as a reasoning engine to determine which actions to take and in which order. Attend this session to learn how to craft AI Agents in JavaScript using LangChain and other prompt engineering techniques. Alohomora!

Demo:

In this example you find a node app that can be used to learn LangChain in Javascript. This repository contains a series of sample scripts showcasing the usage of Langchain, a JavaScript library for creating conversational AI applications.

  • 00_basics.js: Introduction to basics of using OpenAI API without Langchain.
  • 01_first_chain.js: How to create your first conversation chain in Langchain.
  • 02_simplesequentialchain.js: A simple example of creating a sequential conversation chain.
  • 03_sequentialchain.js: Detailed walkthrough of creating and utilizing a sequential conversation chain in Langchain.
  • 04_parsers.js: How to use parsers to process input and output in a conversation chain.
  • 05_indexes.js: How to create and use indexes in Langchain for efficient retrieval of information.
  • 06_usestore.js: How to utilize the Vector Databases in Langchain for maintaining and retrieving information which was not trained into the model.
  • 07_chat.js: How to create a chat bot in Langchain, forming the basis of a conversational AI application.
  • 09_zeroshotreact.js: How to create an agent in Langchain the uses Zer Shot ReAct.
  • 09_openaifunc.js: How to create an agent in Langchain the uses OpenAI Functions.
  • 10_conversationalagents.js: How to create an agent in Langchain that designed to be used for conversational settings.
  • 11_planexecute.js: Plan and execute agents accomplish an objective by first planning what to do, then executing the sub tasks. This idea is largely inspired by BabyAGI and then the "Plan-and-Solve" paper.
  • 12_sqltoolkit.js: This example shows how to load and use an agent with a SQL toolkit.
  • 13_sequentialchaincocktail.js: This example shows how to generate unique cocktails.

To run these examples, clone the git repository and run npm install to install die dependencies. You need to create a .env file and add your API Key for OpenAI like this: OPENAI_API_KEY=sk-...

This codes utilizes ES6 modules, to allow import statements and async/await within NodeJS.

Presentation resources

Resources

Speakers

Original source:

ai-agents-js's People

Contributors

rondagdag avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.