r/learnpython • • Oct 16 '26

How should I separate LLM interpretation from memory operations in my Python project?

I've been working on a small Python project that uses an LLM to interpret natural language instructions and manage persistent memories. Right now, it supports remembering, retrieving, updating and forgetting information.

I've been trying to improve the separation between model interpretation and memory operations. I'm still new to Python but I'm interested how I could structure the code better. Feedbacks are appreciated and any flaws I might be overlooking.

GitHub repo: https://github.com/Lionshaft-pixel/ennoic

8 Upvotes

7 comments sorted by

View all comments

Show parent comment

1

u/Friendly_Rope_5688 Oct 17 '26

Thanks for the feedback. I still don't really know much about software architecture so I don't fully understand memory class and interpretation separation yet. So, would it be good idea to create memory class first while keeping my LLM logic same?

2

u/Equivalent_Type6726 Oct 19 '26

yeah that's a good order. build the memory class on its own first with simple save/get/search methods, keep your llm code as is, then just swap the llm code to call the memory class instead of touching storage directly.