◎
Plexus
AI agents that run inside your database, and get better from their own history.
Built on pg_synapse, pg-raggraph, stele and chunkshop. One Postgres.
A typical agent touches five systems
Every arrow is a place where a run can half-finish, disagree with the others, or leave nothing behind to explain it.
App serverthe agent loop
Vector storeretrieval
Memory servicewhat it learned
Eval notebookhow it improves
Databasethe actual data
Plexus puts all of it in one Postgres
Postgres
pg_synapseThe agent runtime. SELECT synapse.execute(...) runs the whole tool-calling loop in one transaction.
pg-raggraphVersioned retrieval. Documents carry effective dates, so you can ask what was true on a given day.
steleMemory with receipts. Every belief points at its evidence; a correction supersedes, it never erases.
chunkshopIngest for policy documents and for the agent's own past runs.
The modelThe only thing outside. Here, Qwen3.6 35B on a DGX Spark. It is a row in a table; swapping it is an UPDATE.
Hold the model fixed. Improve everything around it.
Google Research's harness2 calls the prompt, rules, tools and hints around a model its harness, and tunes that instead of the weights.
System prompt
Guardrails
Memory
Skills
Tool hints
Lessons
- ProposeAn improver reads past runs and suggests edits: how the agent works, and what an expert in the domain would know.
- ProbeEach edit runs once against the real task, in its own throwaway copy of the database.
- ComposeThe best ideas are combined; the cheapest version that still passes every check is adopted.
- ReflectOne lesson is written down for the next round, citing the run it came from.
In Plexus the harness is rows, and every row has a price
Context is the cost. Each component says when it is paid for.
| Component | When it costs context | In this agent |
| System prompt, guardrails, memory, lessons | Always, capped by the database | … |
| Skills | A one-line trigger until the agent loads the full playbook | … |
| Tool hints | Only when a tool call fails, appended to the error | … |
| Lessons | Written by the tuner, each citing its source run | … |
Live
The policy changed. The next refund obeyed it.
Legal shortens the refund window from 30 days to 21 from 1 October by publishing one document. No prompt edit, no redeploy.
v1 14 days
v2 30 days
v3 21 days
ticket 103
20 Jul
ticket 109
10 Oct
JanAprJulOctDec
Refund ticket 109$39, charged 15 Sep, opened 10 Oct: 25 days
Publish refund policy v3one document into pg-raggraph, superseding v2 from 1 Oct
The same refund, againand a July ticket, still judged by the rules of its day
Any decision, explained from one query
Ticket 104, end to end, out of the same database the agent wrote to.
The tuner made the same agent 37% cheaper
Measured on Qwen3.6 35B, eight tickets per run. Every rollout passed every check.
Input tokens per ticket, base harness…
After tuning…
Rollouts that passed…
harness2 is the method. Plexus is where it runs.
| Typical agent stack | harness2 on its own | Plexus |
| A run that dies halfway | Partial writes to clean up | Offline, not its job | One transaction, all or nothing |
| Policy on a given date | The newest document wins | Not its job | Retrieval as of the ticket date |
| Stopping a bad write | Code review and hope | Not its job | A trigger agent vetoes it in the transaction |
| What tuning learns from | Nothing, or a separate eval product | Benchmark rollouts | Your agent's own trajectories |
| Adopting a change | A redeploy | Copy files into your app | An UPDATE, with the evidence attached |
| Systems to run and secure | Four to six | One, plus all of the above | Postgres and a model endpoint |
What it does not do yet
- Model choice still matters. A 4B model tops out at 3 of 5 checks on this task. The 35B model passes; the tuner makes it cheaper.
- The veto is an LLM call per insert. 5 to 10 seconds. Right for refunds, too slow for a hot write path.
- Long runs sometimes quit early. The agent occasionally stops before every ticket is done. The checks catch it; the harness does not prevent it yet.
- The dollar figures are assumptions. The wrong-policy rate in the business case is an input, not a measurement.
What we would build next
| Rules fast path in front of the veto | Clear-cut refunds decided in milliseconds; the model only sees the borderline ones |
| Harness version history | Every adopted change reversible with one call |
| Replay measurement | Re-run old tickets with and without the date check, so the wrong-policy rate is measured |
| Human approval queue | Borderline refunds wait for a person, in the same transaction model |
| Finish-the-job guard | A run cannot end while a ticket it read is still undecided |
Go try to break it
git clone https://github.com/TheYonk/plexus && cd plexus
make deps venv up ingest seed ui
open http://127.0.0.1:8766/deck
github.com/TheYonk/plexus, Apache-2.0. Built on pg_synapse, pg-raggraph, stele and chunkshop.