adapters

package
v0.3.5 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 6, 2026 License: Apache-2.0 Imports: 18 Imported by: 0

Documentation

Overview

Package adapters holds one implementation of eval.Adapter per memory system under test.

The adapters are the fair-comparison surface. Each one is written to make its system look as good as that system can look: brain gets to use checkpoints because it has them, and a store with only add() and search() gets the same information flattened into prose rather than withheld. Where a system loses, it should lose because of what it is, not because of how it was driven here.

Index

Constants

View Source
const BridgeDir = "bench/adapters"

BridgeDir is where the Python shims live, relative to the repo root.

Variables

This section is empty.

Functions

This section is empty.

Types

type Brain

type Brain struct {
	// contains filtered or unexported fields
}

Brain drives this project through the same entry points the MCP server and the CLI use: notes and checkpoints go in, contextpack.Build comes out. No benchmark-only retrieval path — if the suite scores well, the shipped product scores well.

func NewBrain

func NewBrain(embed *provider.Provider, model string) (*Brain, error)

NewBrain builds an adapter over a scratch vault. Pass a nil provider to run lexical-and-graph only, which is fast and needs no model loaded.

func (*Brain) Close

func (b *Brain) Close() error

func (*Brain) DropDerived

func (b *Brain) DropDerived() error

DropDerived is `rm -rf .brain` followed by `brain index` — the claim that the database is a cache, executed. Whatever comes back afterwards is what the vault really held.

func (*Brain) Name

func (b *Brain) Name() string

func (*Brain) Read

func (b *Brain) Read(q eval.Query) (eval.Response, error)

func (*Brain) Reset

func (b *Brain) Reset() error

func (*Brain) Write

func (b *Brain) Write(ev eval.Event) error

type Bridge

type Bridge struct {
	// contains filtered or unexported fields
}

Bridge runs a memory system that is not written in Go.

The systems worth comparing against — mem0, mempalace — are Python. Rather than reimplementing them (which would compare this project against my reading of their README) each runs as a subprocess in its own virtualenv, speaking newline-delimited JSON on stdin and stdout. The shim on the other side is thin on purpose: it translates events into that system's own API and gets out of the way, so what is measured is their retrieval, not my wrapper.

Both are pointed at Ollama, so no API keys are needed and nothing leaves the machine. That also means the comparison is like-for-like: every system in the table is running against the same local models on the same hardware.

func Discover

func Discover() []*Bridge

Discover returns a Bridge for every shim that reports itself runnable.

A shim that cannot import its own package is skipped, not failed: the common case is that the user has not installed that system, and a missing row is honest where a row of zeros would be a lie about the system's quality.

func (*Bridge) Close

func (b *Bridge) Close() error

func (*Bridge) Name

func (b *Bridge) Name() string

func (*Bridge) Read

func (b *Bridge) Read(q eval.Query) (eval.Response, error)

func (*Bridge) Reset

func (b *Bridge) Reset() error

func (*Bridge) Write

func (b *Bridge) Write(ev eval.Event) error

Write hands the event over in both forms: the structured fields, for a system that can use them, and Flatten's prose, for one that cannot. Nothing is withheld from a system because its API is simpler than brain's.

type Dump

type Dump struct {
	// contains filtered or unexported fields
}

Dump concatenates the entire history, newest first, until the budget runs out. The "just give the model everything" ceiling — and the reason Density is a headline metric rather than a footnote.

func (*Dump) Close

func (d *Dump) Close() error

func (*Dump) Name

func (d *Dump) Name() string

func (*Dump) Read

func (d *Dump) Read(q eval.Query) (eval.Response, error)

func (*Dump) Reset

func (d *Dump) Reset() error

func (*Dump) Write

func (d *Dump) Write(ev eval.Event) error

type None

type None struct{}

None answers nothing. The floor: whatever it scores, the suite is giving away for free.

func (None) Close

func (None) Close() error

func (None) Name

func (None) Name() string

func (None) Read

func (None) Read(eval.Query) (eval.Response, error)

func (None) Reset

func (None) Reset() error

func (None) Write

func (None) Write(eval.Event) error

type Recency

type Recency struct {
	// contains filtered or unexported fields
}

Recency keeps the newest events that fit. This is what conversation compaction approximates: no notion of relevance, only of lateness.

func (*Recency) Close

func (r *Recency) Close() error

func (*Recency) Name

func (r *Recency) Name() string

func (*Recency) Read

func (r *Recency) Read(q eval.Query) (eval.Response, error)

func (*Recency) Reset

func (r *Recency) Reset() error

func (*Recency) Write

func (r *Recency) Write(ev eval.Event) error

type StaticFile

type StaticFile struct {
	// contains filtered or unexported fields
}

StaticFile is the CLAUDE.md baseline: a hand-maintained document that a human updates when they remember to.

It receives only documents. That is not a handicap the harness invented — it is the defining property of the approach. Nobody appends every working note and every dead end to a rules file, which is why the file is always current on architecture and always silent on what happened yesterday.

It is Durable: a file survives anything, which is precisely its appeal.

func (*StaticFile) Close

func (s *StaticFile) Close() error

func (*StaticFile) DropDerived

func (s *StaticFile) DropDerived() error

func (*StaticFile) Name

func (s *StaticFile) Name() string

func (*StaticFile) Read

func (s *StaticFile) Read(q eval.Query) (eval.Response, error)

func (*StaticFile) Reset

func (s *StaticFile) Reset() error

func (*StaticFile) Write

func (s *StaticFile) Write(ev eval.Event) error

type VectorRAG

type VectorRAG struct {
	// contains filtered or unexported fields
}

VectorRAG is top-k cosine over embedded events, with no lexical arm, no graph, and no notion of a checkpoint. It is what most "memory layers" reduce to once the marketing is removed, and it is the honest thing to compare against — beating None proves nothing; beating this proves something.

func NewVectorRAG

func NewVectorRAG(p *provider.Provider, model string, k int) *VectorRAG

func (*VectorRAG) Close

func (v *VectorRAG) Close() error

func (*VectorRAG) Name

func (v *VectorRAG) Name() string

func (*VectorRAG) Read

func (v *VectorRAG) Read(q eval.Query) (eval.Response, error)

func (*VectorRAG) Reset

func (v *VectorRAG) Reset() error

func (*VectorRAG) Write

func (v *VectorRAG) Write(ev eval.Event) error

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL