Skip to content

Sample code for: AI Agent Memory in Python: A Primer - #900

Open
lpozo wants to merge 1 commit into
masterfrom
ai-agent-memory
Open

lpozo wants to merge 1 commit into
masterfrom
ai-agent-memory

Conversation

@lpozo

@lpozo lpozo commented Oct 20, 2026

Copy link
Copy Markdown
Contributor

Where to put new files:

  • New files should go into a top-level subfolder, named after the article slug. For example: my-awesome-article

How to merge your changes:

  1. Make sure the CI code style tests all pass (+ run the automatic code formatter if necessary).
  2. Find an RP Team member on Slack and ask them to review & approve your PR.
  3. Once the PR has one positive ("approved") review, GitHub lets you merge the PR.
  4. 🎉

Code examples for the AI Agent Memory in Python: A Primer tutorial. Files live in the ai-agent-memory/ top-level folder, named after the article slug.

  • short_term.py: asks the same question with and without the conversation history.
  • long_term.py: an agent that saves, searches, updates, and deletes its own memories in memories.json through tool calls.

Both scripts declare openai==3.35.1 in inline script metadata and need OPENAI_API_KEY. Generated from the tutorial markdown with the post-materials skill, checked line by line against the article's code blocks, and run locally before pushing.

🤖 Generated with Claude Code

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant