SPARK - Simple Personal AI Reasoning Kernel

SPARK - PhCL: When a 15–20 Year Old Command-Line Architecture Finally Gets Its AI Reasoning Layer

I’ve been developing SPARK on my DGX Spark, but I should probably explain what sits underneath it.

The underlying application is PhCL — Phoenix Command Line.

PhCL is the command-line system I originally wrote roughly 15–20 years ago and used for many years afterwards.

SPARK is the browser interface I now use over PhCL.

So, more accurately, the project is:

SPARK - PhCL

And although the AI parts are new, the basic architecture isn’t.

PhCL was written in preparation for AI

PhCL was built around a persistent tree of small functions.

Each function is a leaf node with a stable item ID.

I could navigate through those IDs, execute a function, provide input when required, and continue into another function.

A script was essentially just a recorded sequence of what I would otherwise type into the command line:

37
82
141
Some text
209

Those numbers are persistent item IDs, not positions in a menu.

If the current function asks for input, the next line is consumed as that input.

So there isn’t really a separate scripting language underneath PhCL.

The script is effectively a recorded interaction with the same command-line application.

For most of PhCL’s life, I was the reasoning agent.

I understood the individual functions and mentally did:

Run this.
Then this.
Give it this value.
Check that.
Then run this.

The software contained the capabilities.

I supplied the intelligence connecting them.

I wrote PhCL with AI in mind, but at the time the missing component was fairly obvious:

the AI wasn’t ready yet.

Now it is.


Small, understandable capabilities first

SPARK - PhCL still begins with bounded leaf functions.

For example:

Check registered services
Check listening ports
Check Docker containers
Check available memory
List installed models
List running models
Start a runtime
Stop a runtime

I deliberately prefer that to initially giving an AI one huge opaque tool called something like:

Manage my Spark

Each leaf should be small enough that I can understand what it does.

The AI can then reason over those capabilities rather than replacing them with an opaque agent.


Now the AI can reason about what should be connected

I’ve recently added another layer.

The reasoning model can inspect the existing PhCL capabilities, their contracts, execution history and existing named processes and ask:

Which of these existing functions become substantially more useful when connected together?

For example, it recently proposed:

Full Service Readiness Sweep

using existing checks for:

  • registered service health
  • port listeners
  • container liveness

It also proposed:

Docker Binding vs Listener Consistency Audit

and:

Model Inventory and Runtime Delta Check

These are important because they are not new generated PHP functions.

They are compositions of capabilities that already exist.

The model provides the semantic judgement:

These things appear useful together.

PhCL then independently validates whether the stable IDs, inputs and execution sequence actually form a valid executable process.

So the division is approximately:

AI reasoning
      ↓
"This combination appears useful"
      ↓
PhCL deterministic validation
      ↓
validated named process

Semantic judgement and executable truth are deliberately different jobs.

The model doesn’t get to make an invalid workflow valid simply because it sounds convincing.


The next step: processes can themselves become capabilities

This is where I think the idea becomes more interesting than simple workflow automation.

Suppose PhCL contains:

#62  Service Health
#63  Listener Audit
#61  Container Liveness

If those three repeatedly form one coherent useful process, that process can be named:

Full Service Readiness Sweep

Eventually it could be promoted into the capability tree itself:

#214  Full Service Readiness Sweep

Future reasoning can then operate on #214 as a meaningful abstraction, rather than rediscovering its three constituent operations every time.

For example:

#214  Full Service Readiness Sweep
#187  Available Memory Check
#193  Builder Runtime Readiness

might later form:

#251  Prepare SPARK for Builder

So the capability structure can develop depth:

Prepare SPARK for Builder
        │
        ├── Full Service Readiness
        │       ├── Service Health
        │       ├── Listener Audit
        │       └── Container Liveness
        │
        ├── Memory Check
        └── Runtime Readiness

That starts to look less like macros and more like progressive abstraction.


Abstraction shouldn’t simply make the tree grow forever

Promoting a process doesn’t automatically make its atomic parts irrelevant.

Some small operations may remain highly useful and interchangeable across many different processes.

Those are good atoms.

But sometimes a higher-level concept may reveal that several old leaves were badly scoped, rarely useful independently, or would be better grouped/reclassified.

So PhCL could eventually reason not only about:

What should be added?

but also:

What should be connected?
What deserves a name?
What should become a first-class capability?
What is still useful independently?
What has become redundant?
What should be recategorised?
What could eventually be deprecated?

The aim isn’t maximum leaf count.

Ideally, the visible system can actually become simpler while the capability graph underneath becomes deeper.

Something like:

Discover
→ Validate
→ Compose
→ Observe
→ Promote
→ Reclassify
→ Deprecate
→ Repeat

AgentGIF fits directly into this model

This is also how AgentGIF fits into the wider project.

My original Agent GIF discussion is here:

Agent GIF - Sharing Intent — OpenAI Developer Community

AgentGIF is itself designed as a PhCL leaf node.

From the underlying system’s perspective it is another bounded capability with inputs and outputs.

The SPARK browser interface can then provide the visual representation of what that leaf does.

That distinction matters to me.

The browser representation isn’t the underlying capability.

It is a human-facing view of it.

So the same underlying PhCL capability could potentially be represented or invoked as:

command-line function
browser control
AgentGIF visual object
named process
scheduled process
event hook
higher-order composition

without those becoming completely separate architectures.


A timely comparison: Perplexity’s Portable Computer

Perplexity’s recently announced Portable Computer is particularly interesting to me because it reaches related territory from almost the opposite starting point.

Introducing Portable Computer for local-first AI — Perplexity

Portable Computer runs Perplexity Computer locally on systems including the DGX Spark. Perplexity describes its orchestrator, planner, tool router, scheduler, durable task queue and local search index as running on-device, with local models doing most work and authorised escalation to cloud capabilities where useful.

That reinforces something I’ve increasingly found while building SPARK:

the model isn’t the system.

The interesting intelligence comes from the structures surrounding the model.

But Portable Computer and PhCL seem to approach that from different directions.

Very approximately:

Portable Computer

Human intention
      ↓
general agent
      ↓
planner / router / scheduler
      ↓
tools / files / services
      ↓
result

Whereas PhCL historically looked more like:

bounded capabilities
      ↓
human reasoning between them
      ↓
scripts / processes

and is now becoming:

bounded capabilities
      ↓
AI reasons about their relationships
      ↓
validated compositions
      ↓
named abstractions
      ↓
higher-order capabilities
      ↓
reasoning over those abstractions

I wouldn’t describe SPARK - PhCL as an alternative implementation of Portable Computer.

Portable Computer is much closer to a general autonomous local computer agent.

The question I’m exploring with PhCL is slightly different:

Given all the bounded capabilities the system already has, what meaningful structure exists between them?

And then:

Can useful compositions themselves become new concepts that future reasoning operates on?

That’s the part I find most interesting.

If:

Service Health
Listener Audit
Container Liveness

form one useful concept, I can call that:

Full Service Readiness

The next reasoning cycle doesn’t necessarily need to rediscover the lower-level relationship.

It can reason using the higher-level concept.

That resembles something people do naturally: once lower-level observations form a useful concept and we give it a name, we can reason using the abstraction without mentally reconstructing every component each time.

The important difference with PhCL is that the abstraction can still be expanded all the way back down to the atomic executable operations.

So it remains inspectable.


Memory and capability abstraction are also slightly different problems

Another interesting comparison is Perplexity’s work on Brain, its self-improving memory for Computer.

Self-improving memory for agents — Perplexity

That work is concerned with learning from previous tasks, corrections, sources and outcomes so future agents begin with better context.

I think there’s a useful distinction:

Brain:
compress experience into reusable knowledge

PhCL:
compress capabilities into reusable abstractions

A mature system probably wants both.

Execution history, failures and corrections can provide evidence for deciding whether PhCL should compose, promote, retain or deprecate capabilities.

So over time the capability structure need not evolve purely because a model thinks something sounds elegant.

It can evolve partly because actual use demonstrates that the abstraction is valuable.


Human inspectability is the bit I want to preserve

I’m not particularly interested in giving a model unrestricted access to its own repository and asking:

Improve yourself.

I’m much more interested in:

Here are the capabilities that currently exist.

Here is what each one does.

Here is how they have actually been used.

Which capabilities should be connected?

Which combinations deserve names?

Which abstractions have become useful enough to promote?

Which lower-level concepts remain valuable?

Which have become redundant or badly organised?

The model supplies reasoning.

PhCL supplies:

stable identity
contracts
deterministic validation
dependency tracking
execution boundaries
history

and I still get to understand the pieces.


What I’ve really been waiting for

For years PhCL contained the functions and I supplied the intelligence between the nodes.

AI can now begin supplying some of that compositional reasoning.

But I don’t particularly want the result to collapse into one enormous opaque agent.

I’d rather intelligence emerge through increasingly useful levels of abstraction:

atomic capability
        ↓
validated process
        ↓
named higher-level capability
        ↓
higher-order composition
        ↓
possible consolidation of the old structure

while always retaining the ability to drill back down and see what something actually does.

In that sense, PhCL hasn’t suddenly become an AI architecture.

It was waiting for the reasoning agent it was originally designed around.

For the first 15–20 years, that reasoning agent was me.

Now it doesn’t have to be.