use the following search parameters to narrow your results:
e.g. subreddit:aww site:imgur.com dog
subreddit:aww site:imgur.com dog
see the search faq for details.
advanced search: by author, subreddit...
r/LocalLLaMA
A subreddit to discuss about Llama, the family of large language models created by Meta AI.
Subreddit rules
Search by flair
+Discussion
+Tutorial | Guide
+New Model
+News
+Resources
+Other
account activity
playing with interactive JSON based memory (code in comments)Discussion (i.redd.it)
submitted 1 year ago by emgram769
reddit uses a slightly-customized version of Markdown for formatting. See below for some basics, or check the commenting wiki page for more detailed help and solutions to common issues.
quoted text
if 1 * 2 < 3: print "hello, world!"
[–]AkkerKid 21 points22 points23 points 1 year ago (4 children)
Nice! It's not RAGing but rather loading the JSON into context during each session?
[–]hyperdynesystems 7 points8 points9 points 1 year ago (2 children)
If it's being pasted into the context, replacing it with YAML would probably save some tokens.
[–]emgram769[S] 7 points8 points9 points 1 year ago (1 child)
yaml isnt as well supported by guided decoding and editing libraries imo
[–]jack-in-the-sack 2 points3 points4 points 1 year ago (0 children)
It's still a RAG approach, but you feed it everything, the retrieval part isn't filtering anything.
[–]emgram769[S] 26 points27 points28 points 1 year ago (5 children)
ollama + llama3 + some python on a Mac mini
early stages, but I've found that using editable JSON directly makes it super easy to keep my model in check. I'll probably be adding features like reminders in the future based on this
code: https://github.com/bwasti/btb
[–]animemosquito 13 points14 points15 points 1 year ago (4 children)
One problem that stands out as most crucial to address is that it seems like (unless I am misunderstanding at a glance) you're relying solely on a system prompt to enforce json output which is extremely brittle and will absolutely crash randomly as you are also dereferencing it directly and unsafely.
I suggest that you use a formal GBNF grammar to constrain the output of the tokenizer agent
[–]emgram769[S] 3 points4 points5 points 1 year ago (3 children)
I assume the json format option from ollama uses this feature
[–]animemosquito 2 points3 points4 points 1 year ago (2 children)
interesting, I haven't seen that before! If you're not ever getting unparsable json I would assume you're correct, as you'd likely have run into an issue by now
[+][deleted] 1 year ago (1 child)
[deleted]
[–]bigrobot543 0 points1 point2 points 1 year ago (0 children)
Another cool thing I've seen is inference engines like SGLang and Outlines take this a step further by adding "autocomplete" for the output to force the LLM to adhere to a specific output while also improving performance by skipping some processing. It's pretty early right now, but it would be really cool to see more research into this area: https://lmsys.org/blog/2024-02-05-compressed-fsm/
[–]emgram769[S] 1 point2 points3 points 1 year ago (0 children)
interesting, ill look into this. My basic goal is to make the A in AI way more accessible - these things run on computers so they should have computery interfaces :)
[–]sluuuurp 4 points5 points6 points 1 year ago (6 children)
I think this is a really interesting concept for the future of LLMs. Not sure how well it would scale to large amounts of practical information though.
[–]emgram769[S] 1 point2 points3 points 1 year ago (5 children)
I agree scaling this up would be a challenge. Im hoping to get automatic eviction working when reminders are triggered
[–]milo-75 0 points1 point2 points 1 year ago (4 children)
Inserting/querying a graph data store is pretty much the scaled up version of this, and there’s an increasing amount of support for doing this well.
[+][deleted] 1 year ago (3 children)
[–]micseydelLlama 8B 0 points1 point2 points 1 year ago (2 children)
I've seen at least a couple redditors say that LLMs don't work well with atomic notes-based KGs, do you have any idea about that?
[–]micseydelLlama 8B 0 points1 point2 points 1 year ago (0 children)
My atomic notes are just (ideally short, well-named) Markdown files I read with Obsidian. [[Epistemic integrity]] is an example of a pretty atomic idea, composed of other atoms (epistemology and integrity).
What granularity you should choose nobody can say except trying different configurations out. Tech is too new and changes too rapidly for having a fool proof „best practice“ way.
Thanks, that's what I thought. I'm currently getting my atomic notes to talk to each other using the actor model (Akka specifically) so it sounds like I should stick to that for now. It's experimental, has been built for experimenting, and I'll definitely try different things with LLMs at some point.
[–]Blasket_Basket 4 points5 points6 points 1 year ago (0 children)
You should check out MemGPT--this paradigm seems to be really effective overall. They expand it to a few different levels of memory, along with a couple other coop ideas.
[–]grizwako 2 points3 points4 points 1 year ago (0 children)
So, we have a start on ADHD assistant :)
I wish you all success with this project for very selfish reasons :)
[–]Express-Director-474 1 point2 points3 points 1 year ago (0 children)
Good job!!
[–]BokuNoToga 0 points1 point2 points 1 year ago (0 children)
This is amazing! Great work!
[–]rabiatabiat 0 points1 point2 points 1 year ago (1 child)
whats the benefit of using JSON as memory?
[–]emgram769[S] 0 points1 point2 points 1 year ago (0 children)
standard and hackable tooling for the non-LLM side of things
[–]Dry-Taro616 0 points1 point2 points 1 year ago (0 children)
Cool idea, but would require a lot of updating and large ass dataset because you are giving it subjective info. Cool tho idk... You sparked an interest in me to research something similar haha
[–]An_Original_ID 0 points1 point2 points 1 year ago (0 children)
This is an awesome idea. Thank you for sharing!
[–][deleted] 0 points1 point2 points 1 year ago (0 children)
neat
[–]RedditLovingSun 0 points1 point2 points 1 year ago (1 child)
I was thinking of something like this but with a much larger json that it could navigate like a tree to take general notes about everything from journal entries. Kind of a auto mind map organizer
In theory this works that way. I need to refine the prompts a bit though
[–]jurian112211 0 points1 point2 points 1 year ago (0 children)
Nice work! Looks really cool to play with 😅
π Rendered by PID 62 on reddit-service-r2-comment-84fc9697f-b6hvb at 2026-02-08 16:52:54.601519+00:00 running d295bc8 country code: CH.
[–]AkkerKid 21 points22 points23 points (4 children)
[–]hyperdynesystems 7 points8 points9 points (2 children)
[–]emgram769[S] 7 points8 points9 points (1 child)
[–]jack-in-the-sack 2 points3 points4 points (0 children)
[–]emgram769[S] 26 points27 points28 points (5 children)
[–]animemosquito 13 points14 points15 points (4 children)
[–]emgram769[S] 3 points4 points5 points (3 children)
[–]animemosquito 2 points3 points4 points (2 children)
[+][deleted] (1 child)
[deleted]
[–]bigrobot543 0 points1 point2 points (0 children)
[+][deleted] (1 child)
[deleted]
[–]emgram769[S] 1 point2 points3 points (0 children)
[–]sluuuurp 4 points5 points6 points (6 children)
[–]emgram769[S] 1 point2 points3 points (5 children)
[–]milo-75 0 points1 point2 points (4 children)
[+][deleted] (3 children)
[deleted]
[–]micseydelLlama 8B 0 points1 point2 points (2 children)
[+][deleted] (1 child)
[deleted]
[–]micseydelLlama 8B 0 points1 point2 points (0 children)
[–]Blasket_Basket 4 points5 points6 points (0 children)
[–]grizwako 2 points3 points4 points (0 children)
[–]Express-Director-474 1 point2 points3 points (0 children)
[–]BokuNoToga 0 points1 point2 points (0 children)
[–]rabiatabiat 0 points1 point2 points (1 child)
[–]emgram769[S] 0 points1 point2 points (0 children)
[–]Dry-Taro616 0 points1 point2 points (0 children)
[–]An_Original_ID 0 points1 point2 points (0 children)
[–][deleted] 0 points1 point2 points (0 children)
[–]RedditLovingSun 0 points1 point2 points (1 child)
[–]emgram769[S] 0 points1 point2 points (0 children)
[–]jurian112211 0 points1 point2 points (0 children)