Felicitări!

Agenți text-to-query cu MongoDB și LangGraph

Apoorva Joshi

Senior AI/ML Developer Advocate, MongoDB

Produsul final!

agentic10.jpg

Agenți text-to-query cu MongoDB și LangGraph

Setul de instrumente al agentului

from langchain_mongodb.agent_toolkit.toolkit import MongoDBDatabaseToolkit

# Initialize the MongoDB database toolkit
toolkit = MongoDBDatabaseToolkit(db=db, llm=llm)

# Extract the tools from the toolkit
tools = toolkit.get_tools()
Agenți text-to-query cu MongoDB și LangGraph

Ingineria promptului

from langchain_mongodb.agent_toolkit import MONGODB_AGENT_SYSTEM_PROMPT

# Create a templated prompt for the LLM
prompt = ChatPromptTemplate.from_messages(
    [
        ("system", MONGODB_AGENT_SYSTEM_PROMPT),
        ("system", "Do not re-run tools unless absolutely necessary. If you are not
                    able to get enough information using the tools, reply with
                    I DON'T KNOW. You have access to the following tools: {tool_names}."),
        MessagesPlaceholder(variable_name="messages"),
    ]
)
Agenți text-to-query cu MongoDB și LangGraph

Orchestrarea agentului

langgraph.png

Agenți text-to-query cu MongoDB și LangGraph

Memorie

mongosaver.png

thread_checkpoint.png

Agenți text-to-query cu MongoDB și LangGraph

Ce urmează?

Agenți text-to-query cu MongoDB și LangGraph

Felicitări!

Agenți text-to-query cu MongoDB și LangGraph

Preparing Video For Download...