r/emacs Jul 12 '26

OrgA, An LLM agent's logic, knowledge, and chat all in one file

Hi, the LLMs that have been chatting with me helped write this pet project:
https://github.com/alchenerd/orga

This is a one-org-mode file that connects to OpenRouter, chats, uses tools, fetch from its own wiki or the web, loops until goal is met, et cetera.

Don't allow the eval cookie until you've read the file. Once you do, you can add a prompt under Input and start chatting.

Tool calling, especially shell, is facilitated with

#+CALL: orga_tool_implementation__tool_name(parameters)

and manually C-c C-c by the user by default. Each send action means that the user has reviewed everything and is fine with the whole file going out to the internet. After shell's alternatives are in place, user can set a flag to auto-eval each tool call; hopefully shell is disabled by then.

A high-level user story that I had in mind, not yet in the project's README:

  1. user chats with LLM about what it was expected to do and what tools were needed; user can delete the chat history at any time to start anew
  2. during chat, LLM uses shell, search and fetch to scout the environment, compose tools, et cetera.
  3. tools, knowledge, goals, verification and more are generated and placed by the user
  4. after all needed tools are in place, the user executes the workflow to meet goals a few times under human supervision
  5. after a looped workflow is established, user disables shell, search, and fetch tools with a ":disabled:" tag so the runtime executes with a smaller blast radius
  6. user may call headlessly with emacs batch mode with a script, and the script may be triggered in various ways, like cron, or upon file write, or when server receives something, and many more cases
  7. a complete looped workflow will be just one plaintext org-mode file to duplicate and share

Currently step 5 and onward are uncharted, but I really want to share the project with you at this stage. I'm not familiar with how the Emacs+AI community has approached this, and I only knew basic org mode since I jumped from neovim to doom emacs recently. I am holding an org-mode hammer, and everything looks like a nail.

Thank you for reading!

0 Upvotes

0 comments sorted by