mastodon.world is one of the many independent Mastodon servers you can use to participate in the fediverse.
Generic Mastodon server for anyone to use.

Server stats:

8.1K
active users

#gptel

0 posts0 participants0 posts today

Played around with a gptel chat buffer using a prompt to generate aider src blocks that I can execute to drive an active aider session. Fun stuff. Would be cooler if the block would return a summary of the charge instead of a direction to view the aider session.
#emacs #orgmode #gptel #aider #aidermacs
github.com/karthink/gptel
github.com/localredhead/ob-aid

GitHubGitHub - karthink/gptel: A simple LLM client for EmacsA simple LLM client for Emacs. Contribute to karthink/gptel development by creating an account on GitHub.
Replied in thread

@ciggysmokebringer@kolektiva.social @kerravonsen@mastodon.au @maxleibman@beige.party And, I hit my post length limit. The system prompt is what I use most of the time, I'm refining it little by little until the LLM follows the procedures I lay down for it.

Currently in a little bit of dev downtime, as
#gptel isn't properly dealing with reasoning from the Qwen3 models, which seems to cause issues. https://github.com/karthink/gptel/issues/819

But, the system prompt is growing little by little, and there's additional instructions for each tool in their descriptions, and additional instructions in the tool results where necessary.

My idea is that LLMs are stupid and chaotic, so to get them to do what I want (follow procedures), I have to basically railroad them so following instructions is the only option.

GitHubFailed to call function if response contains content · Issue #819 · karthink/gptelBy longlene

gptel-org-tools

https://codeberg.org/bajsicki/gptel-org-tools

Small update. Largest change: added a per-file regexp option.

Conceptualizing flows that are missing.

One of the key problems that I run into consistently is that the
#LLM will run tools that would blow up its context window, and then refuse to attempt to get to the entries other ways.

I need two things:
1. Find a way to get
less irrelevant stuff from the query results.
2. Find a way to somehow get the results of the same query in chunks, if there's in fact many many results for a query.

Given that we're dealing with anything from a few words to an entire chapter of a book, it makes getting the relevant parts of each matching entry rather tricky.

Maybe I'd be able to use a regexp to pull out the paragraphs that contain the matches? I think that may work, possibly?

The second one... I'm not sure it's possible. The way things are, I'd have to get part of the query, have the LLM summarize it in a subroutine, and then do the second part, summarize, and only then feed it back to the "main" LLM to process it for whatever my request is.

I don't have the VRAM to do that, and I'm not sure if it's possible to make this happen using the hooks exposed by
#gptel, since they'd need to be ran based on a tool result which then would prompt the LLM to run a tool which would then not return results until after it called an LLM (with intermediary tool calls happening) returned results and it processed them.

Man, English makes it difficult to express ideas. But basically, recursion.

In any case, yeah. Bit of a roadblock on this, will need thinking time.

Codeberg.orggptel-org-toolsTooling for LLM interactions with org-mode. Requires gptel and org-ql.

Big hopes for Qwen3. IF the 30A3B model works well, gptel-org-tools will be very close to what I envision as a good foundation for the package.

It's surprisingly accurate, especially with reasoning enabled.

At the same time, I'm finding that
#gptel struggles a lot with handling LLM output that contains reasoning, content and tool calls at once.

I'm stumped. These new models are about as good as it's ever been for local inference, and they work great in both the llama-server and LM Studio UI's.

Changing the way I prompt doesn't work. I tried taking an axe to gptel-openai.el, but I frankly don't understand the code nearly well enough to get a working version going.

So... yeah. Kinda stuck.

Not sure what next. Having seen Qwen3, I'm not particularly happy to go back to older models.

#emacs #gptelorgtools #llamacpp

gptel-org-tools update.

1. Cloned to
https://codeberg.org/bajsicki/gptel-org-tools, and all future work will be happening on Codeberg.
2. Added
gptel-org-tools-result-limit and a helper function for it. This sets a hard limit on the number of characters a tool can return. If it's over that, the LLM is prompted to be more specific in its query. Not applied to all tools, just the ones that are likely to blow up the context window.
3. Added docstrings for the functions called by the tools, so LLMs can look up their definitions.
4. Improved the precision of some tool descriptions so instructions are easier to follow.
5. Some minor improvements w/r/t function names and calls, logic, etc. Basic QA.

Now, as a user:
1. I'm finding it increasingly frustrating that Gemma 3 refuses to follow instructions. So here's a PSA: Gemma 3 doesn't respect the system prompt. It treats it just the same as any other user input.
2. Mistral 24B is a mixed bag. I'm not sure if it's my settings or something else, but it fairly consistently ends up looping; it'll call the same tool over and over again with the exact same arguments. This happens with other models as well, but not nearly as frequently.
3. Qwen 2.5 14B: pretty dang good, I'd say. The Cogito fine-tune is also surprisingly usable.
4. Prompting: I have found that a good, detailed system prompt tends to /somewhat/ improve results, especially if it contains clear directions on where to look for things related to specific topics. I'm still in the middle of writing one that's accurate to my Emacs set-up, but when I do finish it, it'll be in the repository as an example.
5. One issue that I still struggle with is that the LLMs don't take any time to process the user request. Often they'll find some relevant information in one file, and then decide that's enough and just refuse to look any further. Often devolving into traversing directories /as if/ they're looking for something... and they get stuck doing that without end.

It all boils down to the fact that LLMs aren't intelligent, so while I have a reasonable foundation for the data collection, the major focus is on creating guardrails, processes and inescapable sequences. These will (ideally) railroad LLMs into doing actual research and processing before they deliver a summary/ report based on the org-mode notes I have.

Tags:
#Emacs #gptel #codeberg #forgejo #orgmode #orgql #llm #informationmanagement #gptelorgtools

PS. Links should work now, apparently profile visibility affects repo visibility on Codeberg. I would not have expected that.

PPS. Deleted and reposted because of strong anti-bridge sentiment on my part. Screw Bluesky and bots that repost to it. Defederated: newsmast.*

Codeberg.orggptel-org-toolsTooling for LLM interactions with org-mode. Requires gptel and org-ql.

So currently I'm hosting gptel-org-tools on my own forge...

https://git.bajsicki.com/phil/gptel-org-tools

I can't seem to find a good way for people to create issues.

I thought that creating issues via email was a thing with Forgejo, but it appears not.

So here's a poll. Despite my hatred of Microsoft, is it for the best to move the repo to GitHub?

Or is there some way to federate with GitHub users so I don't need to open public sign-ups on my git?

I'm not exactly clear on what the move is here.

#Emacs #gptel #gitforge #forgejo #github #microsoft #foss

Phil's Gitgptel-org-toolsTooling for LLM interactions with org-mode. Requires gptel and org-ql.

Update:
- Fixed up a number of functions. Abstracted some, improved descriptions for better comprehension by LLMs.
- Tried to disable org-ql caching, but it's tricky so caching is still on.
- Fixed up list-buffers and open-file tools (on
@karthink@fosstodon.org's advice)
- Disabled a few tools (notably org-ql-select) by default (now you'll have to manually add it to your config), as getting correct query syntax out of an LLM is a losing gamble.
- Updated some documentation.
- Changed some function names.
- Playing around with adding some additional markers for LLMs to use as reference (e.g. to treat pieces of data they get as actually separate.)

It appears to be working, if not better, then at least more reliably now. Some prompting is necessary to avoid it falling back to bad habits (using "X OR Y" in queries, for instance.

Note: reasoning/ thinking interferes very badly with calling tools. I'm not sure why that is, but at the moment I recommend against it.

So far, it works reasonably well for general queries, but I still find that org-ql-select-agenda-rifle (which does what it sounds like) pulls
way too much into context.

I want to develop a way in which queries can be more precise without going keyword by keyword, but also without letting the LLM screw up the syntax.

https://git.bajsicki.com/phil/gptel-org-tools

#emacs #gptel #orgmode

Phil's Gitgptel-org-toolsTooling for LLM interactions with org-mode. Requires gptel and org-ql.

And just a day later, here's a git repo with more philosophy than good code.

I think the philosophy part is more important personally, the code we can fix later.

https://git.bajsicki.com/phil/gptel-org-tools

TL;DR: Emacs (and its ecosystem) makes the whole vectorization/ RAG/ training stuff entirely redundant for this application.

Yes, this code fails still... a bunch, especially given the current lack of guardrails. But the improvement I've seen in the last few days makes me cautiously believe that with enough safeguards and a motivating enough system prompt, an active assistant may be possible.

Image attached isn't
nearly as good as I've seen, but it's an off-hand example that demonstrates it working.

The only thing missing for me to be happy with this is one of those organic, grass-fed LLM models whose existence isn't predicated on theft.

#emacs #orgmode #gptel #orgql

RE:
https://fed.bajsicki.com/notes/a6jw3n155z

So... I strongly disagree with LLMs (mostly with the marketing and the training data issue), but I found a use-case for myself that they may actually be 'alright' at.

I organize my life in
#Emacs #orgmode . It's great.

But over the years, my notes and journals and everything have become so large, that I don't really have a grasp of all the bits and pieces that I have logged.

So I started using org-ql recently, which works great for a lot of cases, but not all.

Naturally, I wanted more consolidation between the results, and better filtering, as well as a more general, broad view of the topics I wanted to look up in my notes.

So I started writing some tooling for
#gptel, to allow LLMs to call tools within Emacs, and leverage existing packages to do just that.

It's in its inception, and works only 20-25% of the time (because the LLM needs to write the queries in the first place), but it works reasonably well even with smaller models (Mistral Small 24B seems to do alright with 16k context, using llama.cpp).

In general:
- It kinda works, when it wants to.
- The main failure point at the moment is that the LLM isn't able to consistently produce proper syntax for org-ql queries.
- The context window sucks, because I have years of journals and some queries unexpectedly explode, leading to the model going stupid.

So far it's been able to:
- retrieve journal entries
- summarize them
- provide insights on habits (e.g. exercise, sleep quality, eating times)
- track specific people across my journal and summarize interactions, sentiment, important events

It doesn't sound like a lot, but these are things which would take me more time to do in the next year than I already spent on setting this up.

And I don't need to do anything to my existing notes. It just reads from them as they are, no RAG, no preprocessing, no fuss.

At the same time, this is only part of my plan. Next:

1. Add proper org-agenda searches (such that the LLM can access information about tasks done/ planned)
2. Add e-mail access (via mu4e, so it can find all my emails from people/ businesses and add them as context to my questions)
3. Add org-roam searches (to add more specific context to questions - currently I'm basing this entire project around my journal, which isn't ideal)
4. Build tooling for updating information about people in my people.org file (currently I do this manually and while there's a bunch of stuff, I would
love if it was more up to date with my journal, as an additional context resource)

For now, this is
neat, and I think there's potential in this as a private, self-hosted personal assistant. Not ideal, not smart by any means (god it's really really not smart), but with sufficient guardrails, it can speed some of my daily/ weekly tasks up. Considerably.

So yeah. I'm
actually pretty happy with this, so far.

PS.
#orgql because org-ql doesn't show as an existing tag.

Replied in thread

@DodoTheDev in respect to mobile, I guess it depends on what you’re doing with the mobile client? Mostly viewing or you need to edit too?

Syncthing should solve syncing any type of non virtual file, and now has an astounding iOS client. If you write in markdown any client should do on iOS for basic editing, and there are couple of org clients for basic editing or task management (orgro, scratch, plain org, journelly, beorg). I rarely edit on my phone.

Emacs learning curve can be mitigated by starting with a configuration framework like doom or other. It’s not different than learning any other new software you pick up. Hopefully not being to use Ctl-c Ctl-v in emacs is not a showstopper, though there’s a package for that too…

The return on the initial investment in learning #emacs is unmeasurable. Just have a look at the expanding ecosystem of #ai packages to start with… from #gptel to ollama-buddy etc.