Skip to content

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

Merged
brendaweles merged 5 commits into
masterfrom
ai-agent-memory
Dec 1, 2026
Merged

brendaweles merged 5 commits 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

@brendaweles
brendaweles merged commit 9e91e88 into master Dec 1, 2026
1 check passed
@brendaweles
brendaweles deleted the ai-agent-memory branch December 1, 2026 23:46
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.

3 participants