J version of Pi Agent Harness

67 views
Skip to first unread message

Thomas McGuire

unread,
May 16, 2026, 3:45:34 AM (10 days ago) May 16
to forum
So I have been looking for Agentic software that works without Anthropic since their prices have gone way up even when using Openrouter (pay as you go). So Claude Code has gotten fairly expensive for my purposes. 

I came across Pi Agent Harness and tried it out on making a pure J version of Pi. It doesn't have all the functionality of Pi but it does give a view of how to put an agent together under J. 

I haven't fully tested it out but it is functional. It's about 25 files of J code (2449 lines in total). The largest file is agent.ijs with 156 lines of J. 

It's helpful if nothing else to see what is going on in Agentic software from a J implementation perspective. Aside from pointing out some J idioms and finding a couple of libraries not in the admins it was generated entirely by Pi. 

You can find the repo here: https://github.com/tmcguirefl/jpi

I thought I would share it with the J-community since it's interesting from the perspective of architecture and general functionality. It's part of my learning process to understand the underpinning of AI and its tools. 

Tom McGuire

Henry Rich

unread,
May 18, 2026, 6:18:47 PM (7 days ago) May 18
to fo...@jsoftware.com
This project shows that AI can be used for writing J.  What I want to
know is, what should we at Jsoftware be doing to make this easier and
better?

I would like to have a Zoom meeting where interested Jers can check out
the AI bandwagon as it relates to J.  There seem to be several Jers who
have been using Claude Code and I bet many more who are interested in
the idea.

If you would like to be in on this meeting, reply to this message,
giving your email address, and I will work on scheduling it.

Also suggest items for discussion.  Some that come to mind are:

1 Can AI write idiomatic J?

2 How does AI/J compare to AI/Python or AI/C, in size, quality,
documentation, effectiveness of tests?

3 Does the AI need more training in J features?

4 Where in the process does AI use its knowledge of J?  Is it a
last-minute choice of output language?

5 Are there J features that the AI cannot use because it lacks an
internal model of them?

Henry Rich
> To unsubscribe from this group and stop receiving emails from it, send
> an email to forum+un...@jsoftware.com.

Michal Wallace

unread,
May 18, 2026, 7:01:22 PM (7 days ago) May 18
to fo...@jsoftware.com
I'd like an invite to that. I posted a while back about a J MCP server:

https://github.com/tangentstorm/j-mcp

... that's a tool you can give to an agent so it can actually run J interactively,
which I find dramatically reduces hallucinations about how J actually behaves.

(Pi doesn't support MCP out of the box, but the idea (at least with the original)
is to provide a bare bones agent that knows how to extend itself, so you can
just ask it to add MCP support.)


For what it's worth, I've been brushing up on my linear algebra,
and I use J not just for coding but for talking to the AIs about math.
They tend to understand the notation pretty well. 

Example: this quiz preparation conversation with grok. (It looks like I'd
already introduced it to the idea of conversing in J in a previous conversation,
and it just remembered that I do that and didn't question me at all when I

Skip Cave

unread,
May 18, 2026, 7:08:24 PM (7 days ago) May 18
to fo...@jsoftware.com
Henry,

I would be interested in attending a Zoom meeting that discusses AI code using J.
Let me know when you plan to hold the meeting...

Skip


Skip Cave
Cave Consulting LLC

Devon McCormick

unread,
May 18, 2026, 7:50:08 PM (7 days ago) May 18
to fo...@jsoftware.com
Me too!

Devon McCormick



Thomas Arneson

unread,
May 18, 2026, 8:24:14 PM (7 days ago) May 18
to fo...@jsoftware.com

William Szuch

unread,
May 18, 2026, 8:24:33 PM (7 days ago) May 18
to fo...@jsoftware.com
Please invite - email:

bsz...@wsa-fincon.com.au

Thomas McGuire

unread,
May 18, 2026, 10:11:48 PM (7 days ago) May 18
to fo...@jsoftware.com
Include me on the invite.

One thing I have done to help Claude code is to take the some of documents that come with the J interpreter and convert them into Markdown. That helps reduce the processing on the LLM side since they don't have to deal with PDFs which can take time. So I have a docs directory that I didn't put under Git because though it's freely provided it is copyrighted material so that would be something to discuss. Can we produce a set of J documentation tailored for LLMs.

The other thing about these agents is that their LLMs like to program like they are using python. So they love to create large case statements and if-ifelse-then statements. So there are 2 scenarios Claude code doesn't know about a J idiom and brute forces it with control statements and 2 Claude code really doesn't understand the documentation. So for my JHS MCP code I had to provide some input about what JHS was and how it works for Claude code/LLM to understand what I was trying to do. It was treating JHS as a library for HTTP processing instead of a web server like apache.

I also have found that I sometimes need to switch models and start again. I was using qwen at one point to save money but then it could not get past an issue when I was trying to make the j-kvm github repository work for a Mac. I had to switch to another model and work from the bottom up to get things working. 

The point is Claude code can do J code but needs some hints along the way. After I have provided a few hints I usually ask it to summarizes the idioms and pointers Claude code needed to produce better code and put that in a Markdown file for future projects. 

Tom McGuire

LdBeth

unread,
May 18, 2026, 11:09:49 PM (7 days ago) May 18
to fo...@jsoftware.com
>>>>> In <72915f23-dfbd-4ada...@gmail.com>
>>>>> Henry Rich <henry...@gmail.com> wrote:
> This project shows that AI can be used for writing J. What I want to
> know is, what should we at Jsoftware be doing to make this easier and
> better?

Based on my impression, Google Gemini Pro can already give sensible
explanation to some of my original long J 1-liners. Not sure if that
has anything to do with the J user forum been hosted on their
service. :D

> I would like to have a Zoom meeting where interested Jers can check
> out the AI bandwagon as it relates to J. There seem to be several
> Jers who have been using Claude Code and I bet many more who are
> interested in the idea.

> If you would like to be in on this meeting, reply to this message,
> giving your email address, and I will work on scheduling it.

Please add my email to the meeting list: and...@foxmail.com

Francesco Pedulla'

unread,
May 19, 2026, 5:32:37 AM (7 days ago) May 19
to fo...@jsoftware.com
Please add me to the meeting: mel...@gmail.com.
Hope the timing will be OK for Europe.
Thanks,

Francesco Pedulla'

Pascal Jasmin

unread,
May 19, 2026, 7:24:11 AM (7 days ago) May 19
to fo...@jsoftware.com
I'd like to join zoom.

MiMo 2.5pro is first/only model to answer in first shot, what is */(-:@) 1 2 3

There's still over 10 models, all towards larger end, that are helpful in generation, but quality is mediocre, mostly because there is a smaller encyclopedia to train on.

General failure mode is that token prediction engines will just guess instead of think.  Agent/skills can help a bit, especially where they outlive models 1-2 month release cycles.  

One idea is an intermediate language.  The above expression could be written as [dyad verb *][adverb returns verb /][adverb returns verb ([monad verb -:][conjunction returns verb @])] 1 2 3

I have not experimented much with the above format.

Will Springs

unread,
May 19, 2026, 8:03:33 AM (7 days ago) May 19
to fo...@jsoftware.com
I’m interested to join - will.g....@gmail.com

Remington Furman

unread,
May 19, 2026, 11:03:41 AM (7 days ago) May 19
to fo...@jsoftware.com
On 5/18/26 7:11 PM, Thomas McGuire wrote:

> Include me on the invite.
>
> One thing I have done to help Claude code is to take the some of
> documents that come with the J interpreter and convert them into
> Markdown. That helps reduce the processing on the LLM side since they
> don't have to deal with PDFs which can take time. So I have a docs
> directory that I didn't put under Git because though it's freely
> provided it is copyrighted material so that would be something to
> discuss. Can we produce a set of J documentation tailored for LLMs.

I'm an anti-AI luddite, so please don't invite me to the meeting.

However, an offline text version of the J documentation would be
helpful as a human user.  At least, all of NuVoc, not just a
cheatsheet.  An offline download of the NuVoc wiki HTML pages would be a
good start.  I'm not always online.

The February discussion about "help and man" between Jan-Pieter Jacobs
and Eric Iverson is a promising step in that direction when you know
what to search for.  But complete text serves serendipity.

IMO, the J documentation is very good once you learn how to read it.  I
believe it is very terse because it was written with the expectation
that users have and are willing to put in the effort to understand it. 
I appreciate the brevity compared to the Python docs, and I wouldn't
want the user-facing docs to balloon to provide training material for LLMs.

On 5/18/26 6:51 PM, 'Pascal Jasmin' via forum wrote:
> One idea is an intermediate language.  The above expression could be written as [dyad verb *][adverb returns verb /][adverb returns verb ([monad verb -:][conjunction returns verb @])] 1 2 3

Putting my elitist gatekeeper hat on, "notation as a tool for thought"
is for my thoughts, not a machine's.  Once you learn (or lookup) the
properties of a primitive, such annotations aren't necessary.

That said, it would be a win when supporting LLMs also helps human users
learn J without LLMs.  A modifier or verb that executes/parses some code
and outputs an annotated IL could be useful for humans trying to
understand a line of unfamiliar code. Like a text-only version of
dissect, or how 13&: transforms code into a tacit form.

-Remington

PS. I admire the array language family for the amount of human thought
that has gone into the design and implementation, how much effort the
users put into learning them, and how much the community teaches.  Maybe
something good will come out of LLMs, but I will be sad it it's mostly
used to circumvent real learning and teaching.

Henry Rich

unread,
May 19, 2026, 11:14:10 AM (7 days ago) May 19
to 'Pascal Jasmin' via forum
I need an email address.

Henry Rich

unread,
May 19, 2026, 11:14:31 AM (7 days ago) May 19
to 'Skip Cave' via forum
I need an email address.

hhr

David C. Salthouse

unread,
May 19, 2026, 12:57:44 PM (7 days ago) May 19
to fo...@jsoftware.com
Please count me in


David C. Salthouse  

J. Patrick Harrington

unread,
May 19, 2026, 2:28:51 PM (7 days ago) May 19
to fo...@jsoftware.com
I would be interested in at least lurking.  My best email is khn...@verizon.net

Jan-Pieter Jacobs

unread,
May 19, 2026, 4:49:31 PM (6 days ago) May 19
to fo...@jsoftware.com
Hi Henry,

Thanks for organizing this. I'm also interested in joining: janpiete...@gmail.com .

Best regards,
Jan-Pieter

Don Guinn

unread,
May 19, 2026, 5:58:15 PM (6 days ago) May 19
to fo...@jsoftware.com
I would like to lurk too.

Maybe use AI to produce a summary of the meeting.

Norman Drinkwater

unread,
May 19, 2026, 6:05:08 PM (6 days ago) May 19
to fo...@jsoftware.com
Please add me to the list.
Thanks.
Norman Drinkwater

On Mon, May 18, 2026 at 5:18 PM Henry Rich <henry...@gmail.com> wrote:

chris burke

unread,
May 19, 2026, 7:55:42 PM (6 days ago) May 19
to fo...@jsoftware.com
> However, an offline text version of the J documentation would be helpful as a human user.

See jwiki.zip on page code.jsoftware.com/wiki/Help/Offline for an
offline version of the wiki.

Jared

unread,
May 19, 2026, 8:41:24 PM (6 days ago) May 19
to fo...@jsoftware.com
I would like to join if i can.

m...@thoughtcrop.com



I use mistral vibe cli and their latest model mistral medium 3.5 tells me it was trained on J.

It answers Pascal's test.

Vibe cli sends telemetry to mistral on usage and a couple of my niche languages that i have pestering it about have now been trained. (Shen, sac)

When I first started with vibe cli I had created a j skills file, but now that isn't necessary.

I'm not experienced with J to test whether it is terrible or not. But it is much improved compared to a couple months ago.

Jared Nicholson

Sent from Proton Mail for iOS.

-------- Original Message --------

LdBeth

unread,
May 20, 2026, 4:12:34 AM (6 days ago) May 20
to fo...@jsoftware.com
>>>>> In <1680641453.32536...@mail.yahoo.com>
>>>>> "'Pascal Jasmin' via forum" <fo...@jsoftware.com> wrote:
> I'd like to join zoom.

> MiMo 2.5pro is first/only model to answer in first shot, what is */(-:@) 1 2 3

> There's still over 10 models, all towards larger end, that are helpful in generation, but quality is mediocre, mostly because there is a smaller encyclopedia to train on.

> General failure mode is that token prediction engines will just guess instead of think.  Agent/skills can help a bit, especially where they outlive models 1-2 month release cycles.  

> One idea is an intermediate language.  The above expression could be written as [dyad verb *][adverb returns verb /][adverb returns verb ([monad verb -:][conjunction returns verb @])] 1 2 3

> I have not experimented much with the above format.

Without any J execution tool, Opus 4.7 as chat assistant would first
say "probably syntax error", which is a good sign, and once given the
hint that is a "modifier train", can give the correct result.

Sonnet 4.6 or DeepSeek V4 both failed to show understanding of
modifier train in their chat interface.

I guess modifier train is a relatively obscure feature in J, so it
requires some "Big" and more recent world knowledge for a general
purpose LLM to know that in the first place.

However, when presented with jconsole and inside Claude Code, Sonnet
4.6 or DeepSeek V4 Pro both are able to explaining the result
correctly, when used with Claude Code the two models outperforms their
Chat interface version equipped with a J mcp tool. Sonnet 4.6 used
more bash tool calls, and DS V4 Pro gets there with only reasoning.

In a much broader sense, the publicly available AI agents have passed
the point to be able to solve problems outside training data when
equipped with external tool calls.

david alis

unread,
May 20, 2026, 3:50:23 PM (5 days ago) May 20
to fo...@jsoftware.com
I would like to join if I can ...

thanks

David

Pascal Jasmin

unread,
May 20, 2026, 6:14:52 PM (5 days ago) May 20
to fo...@jsoftware.com
The qwen 3.6 and gemma 4 recent model sizes in 27-35b are hyped for achieving opus 4.5 level benchmarks, and can be retrained on single gpu rental quickly and cheaply.  They are simply so horrible at J, that it would be long shot to use them as a base.

Many models including google's AI mode, though terrible at understanding full above expression, can get a full train right if they are fed "in J what is (-:@)" , then after correct identification are fed rest of expression.  Non thinking models, of sufficient size/capability, can get this right in very few tokens and time by staying focused on right path.  Though 50/50 it will interpret expression as -:@*/ but give correct result of -:@(*/).  in qwen 27b, not only is it extremely slow at receiving corrections, but 10-15 prompts later it will confuse -:@ with negate then equal, and it turned * into power.  simply catastrophic forgetting that makes hype around the model "fake benchmaxing".  Qwens recent and older larger models are fine though.

You are right that frameworks with access to console execution can do much better, but sometimes they use it as a crutch and make 50 calls of gibberish without reasoning.  That adverb trains and (v c) as adverbs have been a consistent J feature for 30+ years, shouldn't be as confusing/complex as recently resurrected modifier trains.  Recent models do train on recent J documentation though.

To address what can Jsoftware/us do to help LLMs:

1. Most promising: focus on improving agentic frameworks which are more durable, and work is portable to any future agentic framework.  A pretokenizer tool to tell rather than hope the LLM figures out forms of speech.  console verification.  test frameworks...

2.  More verbose parser documentation rewriting rules as sentences.  Just guessing.  But having a master J plan learnable by LLMs can only help them.

3. Least promising:  fine tune an existing LLM.  Main problem, there is a better candidate if you just wait an extra week to commit.  It should be a model small enough to (re)train on a single GPU (common rental availability in west).  Full retraining is limited to that 35gb size.  Qlora retraining can do much larger models with weights merged back into main model, and result can also be served by single GPU for multiple users affordably.  The smaller the model the more affordable, but specialized python/js small models don't give me confidence, while at same time, redoing it every 3 months might be just a few $100 per try. 

Thomas McGuire

unread,
May 21, 2026, 9:10:36 AM (5 days ago) May 21
to forum
Forgot email for Henry to add me: tmcgu...@gmail.com

Michael Dykman

unread,
May 21, 2026, 11:10:00 AM (5 days ago) May 21
to fo...@jsoftware.com
I am extremely interested interested in this topic and would very much like to at least audit the proceedings. 


 - michael dykman
 - mdy...@gmail.com

 May the Source be with you.

Ken Lettow

unread,
May 21, 2026, 11:18:00 PM (4 days ago) May 21
to fo...@jsoftware.com
Please add me to the list.  kle...@gmail.com

Scott Locklin

unread,
May 22, 2026, 5:54:23 AM (4 days ago) May 22
to fo...@jsoftware.com
FWIIW I've done a bit of J in Claude (also in qwen3-coder-next). Mostly to see if it can be done, and mostly working with the FFI. For example:
https://github.com/locklin/vibe-coding-experiments/tree/master/claude-code/jmlpack

I've done quite a bit at this point with other languages which are sparse in the training data. R, Lush, Kerf. Mostly you have to constrain the thing using a CLAUDE.md (or QWEN.md) file which records the places the LLM goes haywire and tells it not to do such things, gives it advice on architecture, testing, large codebases, code organization, things that it does which annoy you, etc. If you've ever seen one before; here's one for Lush: https://github.com/locklin/lush-claude/blob/master/CLAUDE.md

 A jsoftware vendored CLAUDE.md would be great. They seem to be fairly interchangeable with other LLMs, but I've only used Claude and various versions of Qwen. FWIIW I'd never have looked into LLMs but for Qwen's (chatbot not coding agent) ability to make decent small J verbs, which I think is a pretty good test for LLM capabilities.

-SL

Mike Day

unread,
May 22, 2026, 10:44:04 AM (4 days ago) May 22
to fo...@jsoftware.com
Thanks,  Henry

I neither enjoy nor shine in zoom-like sessions,   but would appreciate access to 
the video if one eventually arises. 

Cheers,

Mike 
mike_l...@tiscali.co.uk ... tho Liz won't be interested!

Sent from my iPad
Reply all
Reply to author
Forward
0 new messages