cookbook icon indicating copy to clipboard operation
cookbook copied to clipboard

[New Example] Long Term Memory for Gemini

Open lucifertrj opened this issue 2 months ago • 14 comments

  • Save the preference in the Mem0.AI for the memory layer
  • Based on the given user query, search and retrieve similar preferences from the memory layer.
  • This example is use case driven that is useful for the recommendation systems and travel or food place planner.
  • It uses Gemini as LLM, Qdrant as Vector Store and FastEmbed as Embeddings (open source)

lucifertrj avatar Oct 08 '25 21:10 lucifertrj

[!NOTE] Gemini is unable to generate a summary for this pull request due to the file types involved not being currently supported.

gemini-code-assist[bot] avatar Oct 08 '25 21:10 gemini-code-assist[bot]

Check out this pull request on  ReviewNB

See visual diffs & provide feedback on Jupyter Notebooks.


Powered by ReviewNB

/gemini review

Giom-V avatar Oct 08 '25 22:10 Giom-V

[!NOTE] Gemini is unable to generate a review for this pull request due to the file types involved not being currently supported.

gemini-code-assist[bot] avatar Oct 08 '25 22:10 gemini-code-assist[bot]

Hi @lucifertrj, thanks for the contribution!

Please keep the example as a Interactive Python Notebook (.ipynb). Notebooks are the standard format for examples in this cookbook.

It looks like the notebook file isn't rendering correctly on GitHub due to a metadata issue.

image

Could you please try clearing all the cell outputs in your notebook and then pushing the updated file to this PR? That should resolve the rendering issue.

If you're still having trouble, feel free to share a Colab Gist so I can review your work in the meantime.

chunduriv avatar Oct 09 '25 21:10 chunduriv

sure will modify

lucifertrj avatar Oct 12 '25 02:10 lucifertrj

Hey @chunduriv I have removed the cell outputs.

you can view the notebook here: https://github.com/lucifertrj/cookbook/blob/longtermmemory/examples/Long_Term_Memory.ipynb

lucifertrj avatar Oct 12 '25 02:10 lucifertrj

For the GitHub gist, you can refer to this: https://colab.research.google.com/gist/lucifertrj/91c7fc265a6d40733c7a99bcf9aaa31d/long_term_memory.ipynb

lucifertrj avatar Oct 12 '25 02:10 lucifertrj

@Giom-V and @chunduriv any updates? I have formatted the notebook -nbfmt.

lucifertrj avatar Oct 23 '25 15:10 lucifertrj

@lucifertrj I left you some comments. Basically add more explanations about what's happening. Can you also add a "what's next?" section at the end? I'll just try to run the gemini review, but take it with a grain of salt, it can be a bit picky.

Giom-V avatar Oct 31 '25 16:10 Giom-V

/gemini review

Giom-V avatar Oct 31 '25 16:10 Giom-V

@lucifertrj I left you some comments. Basically add more explanations about what's happening. Can you also add a "what's next?" section at the end? I'll just try to run the gemini review, but take it with a grain of salt, it can be a bit picky.

sure. will make the modifications

lucifertrj avatar Oct 31 '25 18:10 lucifertrj

@Giom-V I have resolved the comments:

  • replace the !pip install to %pip install
  • replace GOOGLE_API_KEY to GEMINI_API_KEY
  • Switched the embedding model to Google embedding model (previously it was FastEmbed)
  • Added more information details for memory add operation and search operation
  • Removed the dependency of langchain, earlier we used it for fastembed, now its not needed.

lucifertrj avatar Nov 10 '25 20:11 lucifertrj

@Giom-V any update?

lucifertrj avatar Nov 23 '25 17:11 lucifertrj