Fundamentos de los Agentes Inteligentes y LangChain
Introducci贸n a LangChain
Agiliza procesos usando Agentes AI
Agentes inteligentes de LangChain
Instalaci贸n y configuraci贸n de LangChain
Quiz: Fundamentos de los Agentes Inteligentes y LangChain
Chat Models y Prompt templates
Chat Messages con OpenAI
Introducci贸n a los modelos de chat
Output parsers
Prompt templates en LangChain
Tipos de ChatTemplates: Few-Shot Prompting
Quiz: Chat Models y Prompt templates
Cadenas en LangChain
Introducci贸n a Chains y LCEL
Chat con historial
Integraci贸n de cadena: Runnable y OutputParser
Chat Memory
Implementaci贸n de memoria en cadenas
Quiz: Cadenas en LangChain
Carga de documentos en LangChain
Cargar HTML y Directorio con LangChain
Carga de PDF y CSV con LangChain
Text Splitters
Quiz: Carga de documentos en LangChain
Retrieval-augmented generation (RAG)
VectorStore: Chroma
Introducci贸n a Embeddings
Vectorstore: Pinecone
Chatbot RAG: carga de documentos a Vectorstore
Chatbot RAG: prompt templates, cadenas y memoria
Quiz: Retrieval-augmented generation (RAG)
Agentes en LangChain
Construcci贸n de agentes en LangChain
LangChain Tools
Construcci贸n de agentes con memoria
Quiz: Agentes en LangChain
Ecosistema de LangChain
Ecosistema de LangChain
You don't have access to this class
Keep learning! Join and start boosting your career
Welcome to the exciting adventure of developing artificial intelligence agents. In this tour, we will see how the Lanchain community can improve our projects through the use of prompts available on its platform. Let's dive into it!
Lanchain offers a repository known as Lanchain Hub, where you can find a variety of prompts designed for different purposes, such as chatbots, code writing, and evaluation tasks. This community resource is essential to enrich our applications with proven and versatile solutions.
A prompt is an instruction or set of instructions given to a language model to guide its response. In our case, a prompt can configure how an agent interprets commands or answers questions. By accessing the Lanchain Hub, you get a concrete example of a prompt and its format. This format includes several parts:
Once we copy the prompt, we take it to our workspace, using tools such as Google Colab.
The creation of an agent in Lanchain starts by importing the agent and the creation tools from the Lanchain API. Here is an example of how to do it:
from langchain import create_agent, tools# Create agent agentagent = create_agent( large_language_model=model, tools=tools, prompt=prompt).
Once the agent is created, tasks can be assigned taking advantage of the loaded tools. We import the executor agent and configure it to interact with user input:
from langchain import execute_agent# Configure the agent executorexecute_agent = execute_agent( agent=agent, tools=tools_set).
Once the agent is running, we perform queries using the Invoke
function. This allows us to send input to the agent and receive an appropriate output. This is how a basic query is structured:
response = agent.Invoke(input='Hello, how may I assist you today?').
Subsequently, an excellent functionality of agents is to add memory to them. This allows the agent to remember previous interactions. Here is the process for adding memory to the agent using the GetSessionHistory
function:
# Get session historyhistory = GetSessionHistory(agent)# Queries with memoryagent.Invoke(input='What is my name?')agent.Invoke(input='My name is Bob')
The last challenge will present the integration of all these features in a professional environment, such as Visual Studio Code. The goal is to bring together each of the sections worked on in Google Colab and handle them in a more robust environment. This not only facilitates the development process, but also prepares the project for future implementation and continuous improvement.
With this knowledge, you are more than equipped to move forward and apply these skills to real projects - keep exploring and expanding your AI development skills!
Contributions 2
Questions 1
Want to see more contributions, questions and answers from the community?