folklore GitHub
Peer-to-peer compounding inference

knowledge travels mouth to ear.

Folklore is that — for your agents. Never start your LLM inference from square one.

$ npm install -g @usefolklore/folklorecopy

keeps findings · debug traces · papers read · dead-ends ruled out · syntheses · grounded claims

works with  ·  claude code  ·  cursor  ·  cline  ·  gemini cli  ·  windsurf  ·  zed  ·  continue  ·  aider  ·  roo code  ·  anthropic  ·  openai  ·  gemini  ·  llama  ·  mistral  ·  deepseek  ·  ollama  ·  grok  ·   works with  ·  claude code  ·  cursor  ·  cline  ·  gemini cli  ·  windsurf  ·  zed  ·  continue  ·  aider  ·  roo code  ·  anthropic  ·  openai  ·  gemini  ·  llama  ·  mistral  ·  deepseek  ·  ollama  ·  grok  ·  
Chapter the First — The Problem

agents reason from zero.

The same paper read again. The same dead-ends walked again. The same conclusion re-derived — and re-billed — a thousand times.

You pay OpenAI, Anthropic, every endpoint, per token, to re-run inference over data someone already ground out yesterday. The work was done. Nobody kept the answer.

the work was done. nobody kept it.

Chapter the Second — Alone

Day one, it already pays off.

Folklore sits between your agent and the web. Every research call meets your own graph first. Read it Tuesday? You don't pay Thursday.

tue folklore ask "mxbai vs cross-encoder?"
↳ not in graph — web · 1.8s · 3.2k tokens · saved + signed
thu folklore ask "mxbai vs cross-encoder?"
↳ from your graph · 11 ms · 0 tokens — never paid again
Interlude — From One to Many

alone, it pays. together, it compounds.

One graph spares you the second lookup. A thousand graphs spare the whole network the first. The same motion — kept, signed, passed on — is single-player value and a commons at once.

inherit the reasoning. infer deeper.

Chapter the Third — Together

Peers join. Their reasoning becomes your start.

Graphs answer each other over libp2p. The first hop becomes "what does the network already know?" Every record signed by a named hand.

peer fan-out · libp2p
▸ peer hit · signed @ada-lprz · 3 sources
web fallback   17% ▸ 1%
Chapter the Fourth — The Mechanism

a graph that earns the deny.

  1. i

    Intercept

    A hook catches every WebSearch and WebFetch before it leaves. Local tools never touched.

  2. ii

    Ask the graph

    Hybrid recall, cross-encoder rerank, graph PPR — your pages first, then the network's.

  3. iii

    Deny, or pass

    Score 0.85 with two hits or more, served from memory. Fall short, the fetch proceeds.

  4. iv

    Set it down

    Whatever the web returns is filed and signed, so the next reader pays nothing.

Chapter the Fourth & a Half — A Query, Traced

47-minute debug. 142 ms hit.

One peer pays the cost. The network gets the answer. No server brokers it, no vendor takes a cut.

tue 03:14 · berlin

The work happens once.

$ claude
> long-ctx vllm OOM after fp16 prefix cache;
> raising max_model_len blew the kv budget
[debug session · 47 min]
> root cause: prefix cache page size too small
> fix: --kv-cache-dtype=fp8 + --block-size=32
[folklore · auto-saved trace]
signed · @you · ed25519 3a4b…
wed 18:42 · tokyo

Everyone after skips it.

$ claude
> vllm long-ctx OOM, prefix cache failure
[folklore · asked 3 peers · 142 ms · hit: @you's trace]
> confident answer — web not needed
> 0 web calls. injecting the signed trace.
[claude · reading @you's notes]
> try --kv-cache-dtype=fp8 + --block-size=32
received · @you · verified · 0 web hops

No server brokered it. No vendor took a cut. The trace is now in two graphs. The next query hits three.

Chapter the Fourth & three-quarters — Provenance

anonymous retrieval is a poisoning surface.

Every other AI memory feeds your model unsigned text from nowhere. Folklore signs every record by a verified human, so a model can refuse what it can't trace.

RAG's open wound

5 → 97%

5 poisoned documents can hijack a retrieval system with a 97% attack success rate. The model has no way to tell trustworthy context from an injected lie.

PoisonedRAG, arXiv · Zou et al.

Folklore's answer

Signed by a verified GitHub identity, with an auditable chain: who curated it, what they grounded on, when. Trust becomes a property the model can read.

Chapter the Fifth — The Reckoning

each claim, on disk.

0
tests passing
0
BEIR SciFact NDCG@10
11ms
median retrieval
~140ms
federation-hit P50
Folklore0.7522
Pinecone base0.5840
mem00.4410
Letta0.3150
LangChain RAG0.2680

CPU-only. No model judging a model. Simulator figures — the hundred-peer pilot is next.

Chapter the Sixth — Join the Telling

one command to a peer.

# install + onboard — daemon, hooks, identity
$ npm install -g @usefolklore/folklore
$ folklore onboard

# set down what teaches you
$ folklore save --type synthesis --label "mxbai on long ctx" \
    --text "Cross-encoder wins under 512 tokens; mxbai degrades slower past 2k."

# join a peer, ask the network
$ folklore peer add /ip4/203.0.113.7/tcp/4001/p2p/12D3KooW...
$ folklore ask "mxbai-rerank vs cross-encoder?" --peers
The Guidebook

four moves to never research twice.

It pays off alone on day one — your own graph answers first — and compounds the moment a peer joins. Four moves, the real commands, nothing invented.

i

Install

One global package — the daemon, CLI, and agent hook all ship together.

$ npm install -g @usefolklore/folklorecopy
ii

Hooks & onboard

folklore onboard wires up the daemon, the PreToolUse deny-on-confidence hook, and your signed identity. The hook gates WebSearch and WebFetch — and never touches local Read, Grep, or Glob.

iii

Ask the graph

folklore ask "…" answers from your own graph first — milliseconds, zero tokens. It only falls back to the web on a miss, then files the result so the next ask is free.

iv

Add a peer

folklore peer add … then folklore ask "…" --peers — the first hop becomes "what does the network already know?", every record signed by a real, named hand.

The Name

the lore is the graph;
the folk are the peers.

knowledge that survives by being passed on — never relearned from scratch

The Store

wear the commons.

Browse the full store →
Drops to peers first
Never-Research-Twice tee — folk-pop speech-bubble print on charcoal cotton

Never-Research-Twice Tee

The mark on heavyweight cotton. Hand-drawn folk-pop print, signed by the commons.

Heavyweight 100% cotton · screen-printed front · S–3XL · ink on dark

$— Buy
Drops to peers first
Folk-pop die-cut sticker sheet — sun, swallow, fish, flower, the teller

Folk Sticker Pack

A pack of die-cut folk-pop stickers — fish-flower, sun, and friends from the network's memes.

Die-cut vinyl · matte laminate · weatherproof · 6-sticker sheet ~3in

$— Buy
Drops to peers first
The Hearth enamel pin — folk-pop speech-bubble, hard enamel, gold edges

The Teller Enamel Pin

A hard-enamel pin of the teller — the named hand that signs the lore. Wear the folk on your jacket.

Hard enamel · 1.25in · gold plating · double rubber clutch backing

$— Buy

Prints, posters, pins & more — browse the full store →

$LORE coin

$LORE — minted on bags.fm.

A community memecoin for the commons — for the culture, not the chart. Not financial advice.

Get $LORE
The Memes

told and retold.

Folk knowledge always spread as memes. Ours are minted by the network and posted to the timeline — drop yours; the best ones make the store.

more minting · follow @usefolklore