MulaiMulai sekarang secara gratis

Adding memory to the agent

Latihan ini adalah bagian dari kursus

Text-to-Query Agents with MongoDB and LangGraph

Lihat Kursus

Petunjuk latihan

  • Initialize a MongoDBSaver object using the mongodb_client and compile the graph using it.
  • Use the execute_graph_with_memory() helper function provided, and a thread ID created using uuid4(), to answer the question, "Which states have the most theaters?".
  • Answer the question "How many theaters does California have?" without providing extra context; this will force the agent to rely on its memory.


Note: If you’re running DataLab in Restricted Mode, this exercise isn’t supported yet. We’re actively working on making it available in the future.


Latihan interaktif praktis

Ubah teori menjadi tindakan dengan salah satu latihan interaktif kami.

Mulai berolahraga