Notebooks
N
Neode
Anthropic Memory

Anthropic Memory

Memoryneode-notebooks

🧠 Neode as Memory for Anthropic Claude

Open in Alph

This notebook demonstrates using Neode as a persistent knowledge graph that functions as memory for Anthropic's Claude models.

How It Works

  1. Store Memory: When Claude learns new information, it calls Neode to extract and store triples
  2. Recall Memory: When asked questions, Claude searches Neode for relevant knowledge
  3. Persistent: Knowledge persists across conversations and sessions
[ ]
[ ]

Define Memory Tools

[2]
βœ… Memory tools defined

Implement Memory Functions

[3]
βœ… Memory functions ready

Create Chat Function

[4]
βœ… Chat function ready

Demo: Teaching Claude

[5]
πŸ‘€ User: Hi! My name is Alex and I'm a software engineer at TechCorp. I love building AI applications.

   πŸ”§ Calling store_memory({'information': "User's name is Alex. They are a software engineer at TechCorp. They love building AI applications."})
   πŸ“‹ Result: Stored 11 facts:
Alex β†’ instance_of β†’ person
Alex β†’ works_as β†’ software engineer
Alex β†’ employed_by ...

πŸ€– Claude: Hi Alex! Great to meet you! πŸ‘‹ I've made a note of your background. It's awesome that you're passionate about building AI applications β€” it's such an exciting and rapidly evolving field!

As a software engineer at TechCorp, you're probably at the forefront of some really interesting tech. I'd love to hear more about the kinds of AI applications you're working on or interested in building. Are you exploring anything specific right now, like LLMs, computer vision, recommendation systems, or something else entirely?
[6]
πŸ‘€ User: I'm working on a Python project with FastAPI. My favorite language is Rust though!

   πŸ”§ Calling store_memory({'information': "Alex is currently working on a Python project using FastAPI. Alex's favorite programming language is Rust."})
   πŸ“‹ Result: Stored 10 facts:
FastAPI β†’ instance_of β†’ web framework
FastAPI β†’ programming_language β†’ Python
FastA...

πŸ€– Claude: That's a great combo! πŸπŸ¦€

**FastAPI** is an excellent choice for Python projects β€” it's fast, modern, and the automatic API docs (via Swagger UI) are super handy, especially for AI applications where you might be exposing ML models as endpoints.

And **Rust** as a favorite language β€” great taste! It's hard not to love Rust once it clicks. The memory safety guarantees, blazing performance, and the expressiveness of its type system are really compelling. It's also becoming increasingly relevant in the AI/ML space (think tools like **Candle** by Hugging Face or **Polars** for data processing).

A fun thought β€” have you ever considered using **PyO3** to write Rust extensions for your Python/FastAPI projects? It's a great way to get the best of both worlds β€” Python's ecosystem with Rust's performance for compute-heavy tasks. πŸš€

What does your FastAPI project do, if you don't mind sharing?

Demo: Recalling in New Session

[7]
πŸ‘€ User: What do you remember about me?

   πŸ”§ Calling recall_memory({'query': 'user personal information preferences history'})
   πŸ“‹ Result: Found memories:
β€’ JavaScript was created by Brendan Eich
β€’ JavaScript was created by Brendan Eich
β€’ ...

πŸ€– Claude: It seems I don't have much personal information stored about you yet! The memories I have are mostly general facts and don't appear to be specifically about you.

To build up my memory of you, feel free to share things like:
- **Your name**
- **Your interests or hobbies**
- **Your profession or field of study**
- **Your preferences** (food, music, topics you enjoy, etc.)
- **Any goals or projects** you're working on

The more you share, the better I can personalize our conversations! 😊

View Knowledge Graph

[8]
πŸ“Š Knowledge Graph Contents:
============================================================
  FastAPI β†’ instance_of β†’ web framework
  FastAPI β†’ programming_language β†’ Python
  FastAPI β†’ first_released_on β†’ 2018-12-05
  FastAPI β†’ developer β†’ SebastiΓ‘n RamΓ­rez
  FastAPI β†’ license β†’ MIT License
  FastAPI β†’ built_on β†’ Starlette
  FastAPI β†’ uses β†’ Pydantic
  Rust (programming language) β†’ instance_of β†’ programming language
  Rust (programming language) β†’ first_stable_release_date β†’ 2015-05
  Rust (programming language) β†’ originated_as_side_project_in β†’ Mozilla Research
  FastAPI β†’ instance_of β†’ web framework
  FastAPI β†’ programming_language β†’ Python
  FastAPI β†’ first_released_on β†’ 2018-12-05
  FastAPI β†’ developer β†’ SebastiΓ‘n RamΓ­rez
  FastAPI β†’ license β†’ MIT License
  FastAPI β†’ built_on β†’ Starlette
  FastAPI β†’ uses β†’ Pydantic
  Rust (programming language) β†’ instance_of β†’ programming language
  Rust (programming language) β†’ first_stable_release_date β†’ 2015-05
  Rust (programming language) β†’ originated_as_side_project_in β†’ Mozilla Research
  Alex β†’ instance_of β†’ person
  Alex β†’ works_as β†’ software engineer
  Alex β†’ employed_by β†’ TechCorp
  Alex β†’ enjoys_activity β†’ building AI applications
  Alex Chen β†’ job_title β†’ Senior Software Engineer
  Alex Chen β†’ employed_by β†’ TechCorp
  Alex Chen β†’ specializes_in β†’ full-stack development
  Alex Chen β†’ uses_technology β†’ React
  Alex Chen β†’ uses_technology β†’ Node.js
  Alex Chen β†’ uses_technology β†’ Amazon Web Services
  Alex Chen β†’ has_years_of_experience β†’ over 5 years
  Alex β†’ instance_of β†’ person
  Alex β†’ works_as β†’ software engineer
  Alex β†’ employed_by β†’ TechCorp
  Alex β†’ enjoys_activity β†’ building AI applications
  Alex Chen β†’ job_title β†’ Senior Software Engineer
  Alex Chen β†’ employed_by β†’ TechCorp
  Alex Chen β†’ specializes_in β†’ full-stack development
  Alex Chen β†’ uses_technology β†’ React
  Alex Chen β†’ uses_technology β†’ Node.js
  Alex Chen β†’ uses_technology β†’ Amazon Web Services
  Alex Chen β†’ has_years_of_experience β†’ over 5 years
  Alex β†’ is_working_on_project_using β†’ Python
  Alex β†’ is_working_on_project_using β†’ FastAPI
  Alex β†’ favorite_programming_language β†’ Rust
  Python β†’ is_a β†’ programming language
  FastAPI β†’ is_a β†’ web framework for building APIs with Python
  Rust (programming language) β†’ is_a β†’ programming language
  FastAPI β†’ is_based_on β†’ Starlette
  FastAPI β†’ uses β†’ Pydantic
[ ]