Export
π§ Neode as Memory for Anthropic Claude
This notebook demonstrates using Neode as a persistent knowledge graph that functions as memory for Anthropic's Claude models.
How It Works
- Store Memory: When Claude learns new information, it calls Neode to extract and store triples
- Recall Memory: When asked questions, Claude searches Neode for relevant knowledge
- 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
[ ]