Skip to content

Instantly share code, notes, and snippets.

@staccDOTsol
Created August 3, 2026 20:33
Show Gist options
  • Select an option

  • Save staccDOTsol/cb26f7783b9bfcee759349d62be900ac to your computer and use it in GitHub Desktop.

Select an option

Save staccDOTsol/cb26f7783b9bfcee759349d62be900ac to your computer and use it in GitHub Desktop.
Stacc Brain — Karpathy llm-wiki at Telegram scale (Obsidian + holographic layer / leCore). Demo: https://brain.stacc.bio

Stacc Brain — Karpathy llm-wiki at Telegram scale

Public demo (readonly shared brain + rate-limited playground):
https://brain.stacc.bio

Obsidian vaults (this machine):

  • /Users/stacc/brain-ab/vault-a — md + redteam wiki
  • /Users/stacc/brain-ab/vault-b — hologram projection + plugin

One-liner

Obsidian is free. The brain that survives your whole Telegram export is Pro.
Shared brains are Hosted. Agents pay per recall.

Pattern (Karpathy)

  1. raw/ — immutable sources
  2. wiki/ — LLM-owned compiled knowledge
  3. schema — agent contract (see AGENTS.md)

Original: https://x.com/karpathy/status/2039805659525644595
Gist idea-file: https://gist.github.com/karpathy/442a6bf555914893e9891c11519de94f

Scale problem → product

At ~100 articles pure md works. At ~300k Telegram messages, agent grep of the vault dies.

Measured A/B (see ab_scale.md / ab_scale_v2.md):

md full-scan hologram index
p50 ~122 ms ~0.02–1.1 ms
speedup ~100–5000×

Shoulders of giants

Layer Who
leCore holographic substrate undacappn (An Oversized Moose) — https://github.com/AnOversizedMooseWithSocks/leCore
Product / market / TG / Obsidian / hosted stacc
Pattern formalization Karpathy llm-wiki

Files in this gist

File What
AGENTS.md How agents ingest / query / lint
MARKETING.md Positioning, tiers, voice
PRODUCTMARKETFIT.md Beachhead, metrics, PMF plan
MONETIZATION.md Free / Pro / Hosted / Agent
ab_scale.md A/B v1 scoreboard
ab_scale_v2.md A/B v2 (A_raw / A_wiki / B)

Install sketch (self)

# open vaults
open -a Obsidian /Users/stacc/brain-ab/vault-a
open -a Obsidian /Users/stacc/brain-ab/vault-b

# TG active conv-turns (api: https://my.telegram.org/apps)
python3 /Users/stacc/brain-ab/code/tg_pull_active.py --dialogs 150 --per-chat 500

# rebuild hologram
python3 /Users/stacc/brain-ab/code/brain_b.py --md /Users/stacc/brain-ab/shared-raw/telegram

# public teach playground
curl -s -X POST https://brain.stacc.bio/v1/playground/teach \
  -H 'content-type: application/json' \
  -d '{"text":"hello playground","title":"note"}'

ACL

  • demo-telegram: everyone read · owner write only
  • playground: everyone read+write · rate-limited (global + per-IP)

Agent-ready idea file for the scale path. Give this gist to your agent with brain.stacc.bio as the live demo.

A/B at scale — quantitative

  • Corpus: 609 chats · ~320904 msgs · 25.0 MB raw
  • Queries: 20 fixed prompts
  • Arm A: full-text scan of markdown (classic Obsidian/Karpathy data layer)
  • Arm B: holographic index (dim=512)

Headline (largest N)

Metric Arm A (md scan) Arm B (hologram)
p50 latency 121.802 ms 0.0219 ms
p95 latency 157.863 ms 0.0283 ms
Mean speedup B÷A 5112.6×
Term-overlap proxy (top-1) 0.1333 0.25
Build time 0.492 s
Storage 24.93 MB raw 1.135 MB matrix
Latency winner B
Proxy winner B

Arm A = full md scan; Arm B = holographic nearest. term_proxy = fraction of query tokens in top-1 title/preview (not human relevance labels).

Scale curve

N chats ~msgs A p50 ms A p95 ms B p50 ms B p95 ms speedup A proxy B proxy B build s
50 238788 84.173 129.244 0.0254 0.2861 399.1× 0.1083 0.1 0.363
100 271910 94.718 128.768 0.0147 0.021 5925.5× 0.1333 0.15 0.289
200 305019 107.941 138.855 0.0176 0.0243 5849.9× 0.1333 0.2 0.372
400 318826 118.807 152.941 0.0197 0.0303 5174.1× 0.1333 0.25 0.567
554 320767 121.802 157.863 0.0219 0.0283 5112.6× 0.1333 0.25 0.492

Interpretation

  • Latency: B should dominate as N grows (A is O(corpus), B is O(dim·N) matmul but tiny).
  • term_proxy: crude lexical check — A often wins pure keyword; B wins fuzzy/structure. Neither is human-labeled gold.
  • Product cliff: Free = A-scale vault; Pro/Hosted = B when scan p95 is painful.

Queries

  • solana rpc endpoint
  • triton
  • liquidity pool
  • pump fun
  • wallet seed phrase
  • mainnet deploy
  • token launch
  • pricing deal
  • airdrop whitelist
  • private key
  • otc allocation
  • intro me to
  • will pay tomorrow
  • connect wallet verify
  • seed phrase send
  • what did I say about rpc
  • azoth
  • deribit api
  • validator stake
  • rug honeypot

A/B at scale v2 — quantitative

Corpus: 627 chats · ~325913 msgs · 25.5 MB raw · wiki 815 files / 1.0 MB

Arms

Arm Simulates
A_raw Grep whole chat markdown vault
A_wiki Karpathy: query compiled wiki only
B Holographic + hybrid keyword

Headline (largest N)

Metric A_raw A_wiki B
p50 free-query 121.8094 ms 14.6212 ms 1.0654 ms
p95 free-query 162.8638 ms 1.3725 ms
Speedup B÷A_raw p50 114.3×
Speedup B÷A_raw p95 118.7×
Planted needle R@1 0.0 0.05
Planted needle R@5 0.0 0.05
Storage 25.5 MB wiki 1.229 MB matrix
B build 0.559 s
  • Latency winner: B
  • Exact-needle winner: B

Scale curve

N ~msgs A_raw p50 A_raw p95 A_wiki p50 B p50 B p95 spd p50 plant R@1 A plant R@1 B B build
50 237190 81.323 101.3071 14.7131 0.1145 0.2495 710.2× 0.0 0.0 0.271
100 271267 105.8407 146.7015 15.8387 0.1973 0.2882 536.4× 0.0 0.0 0.282
200 307193 110.1713 138.8473 14.5769 0.3872 0.4947 284.5× 0.0 0.0 0.361
400 323400 115.0838 151.8616 14.2665 0.7238 1.1243 159.0× 0.0 0.0 0.501
600 325864 121.8094 162.8638 14.6212 1.0654 1.3725 114.3× 0.0 0.05 0.559

Product read

  1. A_raw slows with N. 2. A_wiki smaller surface. 3. B wins latency. 4. Exact needles: A_raw; ship hybrid.

AGENTS.md — how agents operate this brain

This file is the schema for LLM agents (Claude Code, Cursor, Grok, Codex, etc.) that maintain or query the Stacc Brain.

Philosophy (Karpathy): Obsidian is the IDE. The agent is the programmer. The wiki is the codebase.
Scale twist: at Telegram-scale, markdown is not the source of truth for the compiled brain. The hologram + exact side store are. Markdown is raw + projection + human browse.


Product surfaces

Surface Path / URL Agent use
Vault A (md SoT / pitch) /Users/stacc/brain-ab/vault-a Classic Karpathy browse; redteam wiki
Vault B (hologram SoT) /Users/stacc/brain-ab/vault-b Projection + plugin; query via API
Shared raw /Users/stacc/brain-ab/shared-raw/telegram Immutable participated export
Local brain python3 code/brain_b.py / store/brain_b.json Ingest / lint offline
Hosted API https://brain.stacc.bio Query / multi-tenant (when up)
Telethon ~/.holo/tg.session + code/tg_pull_active.py Live + recent active chats

Layers (do not violate)

1. Raw (immutable)

  • Desktop HTML exports, Telethon pulls, live__*.md
  • Never rewrite history. Append new sources; dedupe by (chat, message_id).
  • Full conversation turns (you + counterparties) when a chat is kept.

2. Wiki / compiled

  • Arm A: extractive + redteam wiki under vault-a/wiki/ (chats, people, traps, promises).
  • Arm B: holographic index + optional projection under vault-b/wiki/.
  • Agent may update wiki after ingest; do not hand-edit thousands of raw files.

3. Schema

  • This file + vault-*/schema/CLAUDE.md + MONETIZATION.md.
  • Co-evolve only with explicit human OK for breaking convention changes.

Identity

  • Owner: stacc overflow / notStacc / stacc.
  • Participated filter: chat kept if owner sent ≥1 text message in the window.
  • Redteam lens: counterparties = users, commitments = promises, social-eng / wallet urgency = traps (lexical heuristics, not verdicts).

Operations

Ingest (raw → brain)

  1. Prefer Telethon for recent/active:
    python3 code/tg_pull_active.py --dialogs 150 --per-chat 500
    Live: python3 code/tg_pull_active.py --live
  2. Desktop exports: python3 code/tg_to_md.py / multi-export convert into shared-raw/.
  3. Rebuild hologram:
    python3 code/brain_b.py --md shared-raw/telegram --store store/brain_b.json --wiki vault-b/wiki
  4. Redteam wiki compile: extractive compiler / prior compile pipeline into both vaults when corpus changes.
  5. Hosted: rsync data + systemctl restart brain on the VPS (see deploy scripts).

Query

  1. Prefer POST /v1/{tenant}/query on hosted or local BrainB — not re-reading all of raw/.
  2. Cite raw paths / chat titles for provenance.
  3. For exact string / seed / trap tokens, use keyword/grep over raw (hybrid). Geometry is approximate.
  4. File durable answers as findings / wiki pages when they compound.

Lint

  1. BrainB lint() — tensions, hubs, matrix size.
  2. Redteam ledgers: wiki/traps/ledger.md, wiki/promises/ledger.md.
  3. Orphans / missing entity pages in Arm A wiki.
  4. Never claim “safe” from trap heuristics alone.

Multi-tenant / hosted (layer 3)

Tenant type Auth Use
demo-telegram public Marketing demo (corpus previously publicly leaked)
group-* X-Brain-Key Private group brains
Admin load X-Admin-Key POST /admin/load

Agents serving end users must never mix tenants. One principal → one tenant namespace.


Realtime TG for app users (product)

Human connects their Telegram user session (Telethon-style):

  1. App provides api_id / api_hash from https://my.telegram.org/apps (or platform-managed app).
  2. Login: phone → code → optional 2FA (same pattern as holo/memory/tg_login.py).
  3. Session stored encrypted per user, never in git.
  4. Worker: active dialogs with conv turns + --live forward stream → their tenant raw + hologram rebuild/increment.
  5. User can deny-list chats via filter JSON.

Agents must not request seed phrases, 2FA codes in logs, or session files in chat.


A/B discipline

When changing retrieval:

  • Run python3 code/ab_scale.py (and ab_scale_v2.py when present).
  • Report p50/p95 latency, scale curve, storage, planted-needle R@1 if available.
  • Do not claim quality wins without a defined metric.

Known measured (v1, ~321k msgs): B ~5000× faster p50 than full md scan; B matrix ~1 MB vs ~25 MB raw.


Safety

  • No force-push of secrets. ~/.holo/creds.json and *.session stay local chmod 600.
  • Demo corpus is public-by-prior-leak; private tenants are not.
  • Trap/promise tags are signals for review, not accusations.

Quick commands

# query hosted (when healthy)
curl -s -X POST https://brain.stacc.bio/v1/demo-telegram/query \
  -H 'content-type: application/json' -d '{"q":"solana rpc","k":5}'

# local hologram rebuild
cd /Users/stacc/brain-ab/code && python3 brain_b.py --md ../shared-raw/telegram

# scale A/B
python3 ab_scale.py --raw ../shared-raw/telegram

# open vaults
./scripts/open_vaults.sh

Definition of done for an agent task

  • Raw untouched except append/dedupe
  • Wiki/hologram updated if ingest happened
  • Query path uses brain API when corpus is large
  • Metrics or explicit “not measured” on perf claims
  • No secrets written into the vault or this repo

MARKETING.md — Stacc Brain

One-liner

Obsidian is free. The brain that survives your whole Telegram export is Pro. Shared brains are Hosted. Agents pay per recall.

Credit — shoulders of giants

Layer Who
leCore / holographic substrate undacappn (An Oversized Moose) — leCore, leOS, discoverleos.com
Product + market stacc — Obsidian pitch, TG turns, redteam wiki, hosted multi-tenant, A/B, GTM
Pattern Karpathy llm-wiki (raw / wiki / schema)

We build on leCore; we do not rebrand the engine as ours. We bring the brain product to market.

Category

Karpathy-style LLM wiki / second brain — with a holographic data layer so the product doesn’t die when the corpus is “the whole shebang.”

Not “another notes app.” Not pure RAG that re-derives everything every query.

The problem (make it visceral)

People tried Karpathy’s llm-wiki:

  • Drop raw into a folder
  • LLM compiles interlinked markdown
  • Browse in Obsidian

It feels magic at ~100 articles.

Then they dump:

  • years of Telegram
  • 300k+ messages
  • multi-export Desktop zips

and the system becomes:

  • vault lag
  • agent Glob/Grep forever
  • index.md too big for context
  • every question re-reads the haystack

Measured on a real participated export (~321k msgs, ~600 chats):

Markdown full-scan (Arm A) Hologram (Arm B)
p50 query ~122 ms ~0.022 ms
p95 query ~158 ms ~0.028 ms
Speedup ~5,000×
Query index size 25 MB re-read ~1.1 MB matrix

That’s the demo slide. Numbers live in results/ab_scale.md.

Positioning

vs They sell We sell
Free gist / Claude skill Workflow Scale substrate
Mem0 / Zep / cloud memory Snippet RAG Compiled wiki + Obsidian face
Pure Obsidian wiki md is the DB md is IDE + raw; hologram is the brain
NotebookLM Closed hosted Local-first + optional hosted groups

Pillars (3)

  1. Pitch = Obsidian — install vault, see graph, human trust.
  2. Engine = hologram — bind/bundle/query; flat latency at scale.
  3. Ops = agents — ingest / query / lint; Telethon for live turns.

Audiences

Persona Pain Message
Crypto / TG-native operator 500 chats, deals, traps Redteam lens: users · promises · traps
Researcher / founder Sources compound, wiki rots Karpathy loop without vault death
Team / fund Shared intel, multi-agent Hosted group tenants + keys
Agent builders Memory that isn’t slop MCP/API, hybrid exact+semantic

Product tiers (no token)

Tier Promise Proof
Free Karpathy vault in Obsidian, moderate corpus Open vault-a, plugin optional
Pro Whole export + hologram under same UX A/B scoreboard + local BrainB
Hosted / Group Multi-tenant brains, public demo, private keys brain.stacc.bio
Agent Metered query / MCP (roadmap) API shape already exists

Hero demo

Public: https://brain.stacc.bio
Tenant: demo-telegram — participated Telegram (previously publicly leaked; labeled as demo).

Query examples:

  • solana rpc
  • otc allocation
  • seed phrase (trap surface)
  • person / deal names from the export

Desktop: two Obsidian vaults — A = md story, B = hologram story + Stacc Brain plugin.

Messaging dos / don’ts

Do

  • Lead with Obsidian + scale pain
  • Show latency table
  • Say hybrid: hologram for browse, keyword for exact needles
  • Own “LLM still compiles structured claims”

Don’t

  • Claim pure VSA replaces language models for free-text synthesis
  • Promise 100% recall on fuzzy search without labels
  • Hide that demo data is sensitive-looking — frame as known-public demo
  • Lead with token / chain funding

Campaign angles

  1. “Karpathy wiki, but for the whole shebang” — X thread + scoreboard screenshot.
  2. Redteam TG brain — users / promises / traps ledgers (ops + CT).
  3. Agent memory that compounds — ingest once, query forever.
  4. Open the vault in 60s — plugin → hosted query.

Assets to keep current

Asset Location
Scale A/B results/ab_scale.md
Hosted UI code/static/index.html
Plugin obsidian-plugin/
Agent schema AGENTS.md
Monetization MONETIZATION.md
PMF PRODUCTMARKETFIT.md

Launch checklist

  • brain.stacc.bio health 200
  • Demo query returns real chat titles
  • vault-a + vault-b open in Obsidian with plugin enabled
  • A/B numbers on landing / README
  • Clear Free vs Pro cliff in one sentence

Brand voice

Direct, operator-grade, measured. No “supercharge your productivity” sludge. Prefer numbers, paths, and failure modes.

Monetization

No token rails. Product money only.

Tier What Who pays SKU
Free Obsidian vault + classic md wiki (Arm A path) install / open vault
Pro Local holographic brain under Obsidian (Arm B) individuals with fat corpora license / low sub
Hosted / Group Multi-tenant brains (hosted_server.py) teams, funds, shared intel rooms workspace + seats + QPS
Agent MCP + metered query (later) agents per-call

Layer 3 — Hosted / group leCores (shipped)

  • Isolated tenant per group: separate hologram + store
  • Public demo: demo-telegram — full participated export (previously publicly leaked)
  • Private groups: X-Brain-Key required
  • Admin load: POST /admin/load with X-Admin-Key

Pricing shape (directional)

Plan Includes Ballpark
Demo demo-telegram read-only public query free (marketing)
Group Starter 1 private tenant, ≤50k docs, shared key $99–199/mo
Group Scale multi-tenant, SSO later, audit lint export $299–499/mo
Enterprise dedicated process, VPC, custom ingest custom

Demo as product

Landing: Query a real whole-Telegram Karpathy brain — same Obsidian pitch, holographic data layer.
API + optional thin vault export. Conversion CTA: “Load your export as a private group brain.”

Pitch line

Obsidian is free. The brain that survives your whole export is Pro. Shared brains are Hosted. Agents pay per recall.

PRODUCTMARKETFIT.md — Stacc Brain

Thesis

PMF wedge: people who already believe in Karpathy’s llm-wiki and hit the scale wall on personal comms dumps (Telegram first).

They don’t need education on “second brains.” They need the vault to stay usable when raw is hundreds of thousands of messages — and agents that don’t re-scan the world every turn.


Problem (jobs to be done)

Functional

  • Keep a compounding knowledge base (not stateless RAG every time).
  • Ingest Telegram (export + live) with full conversation turns.
  • Query fast enough that agents and humans actually use it.
  • Surface counterparties, promises, traps for adversarial/ops review.

Emotional

  • Trust local / own-the-data (Obsidian, files).
  • Avoid “I lost the thread of who promised what.”
  • Avoid shame of another abandoned wiki.

Social

  • Teams want a shared brain without dumping everyone’s TG into one Discord.

Solution fit

Need Fit mechanism Evidence
Familiar UI Obsidian vaults + plugin vault-a / vault-b shipped
Scale query Holographic index (BrainB) A/B: ~5k× p50 vs full md scan @ ~321k msgs
Compounding wiki Extractive + redteam ledgers + agent schema wiki/people, traps/, promises/
Live TG Telethon session, conv-turn filter tg_pull_active.py — 78 active chats / +18k msgs in one pull
Hosted groups Multi-tenant HTTP + keys hosted_server.py, demo tenant
Agent-native AGENTS.md + HTTP query schema + API

Honest non-fits

Claim we should not make Why
“No LLM needed for compile” Free prose → structured claims still LLM/human
“Hologram beats grep on exact needles” Planted-string R@1 is A’s game; ship hybrid
“We have multi-user OAuth TG product” User-login Telethon exists; multi-tenant SaaS packaging incomplete
“Always-on public demo” Host must be healthy (brain.stacc.bio has timed out from agent env)

Target market

Beachhead (now)

  • TG-heavy crypto / builder / ops people who already use agents daily.
  • Already tried Obsidian + Claude/Codex wiki.
  • Have Desktop exports or will connect Telethon.

Expand

  • Research / diligence teams
  • Small funds with shared intel rooms
  • Agent platforms needing tenant memory APIs

Not beachhead

  • Casual note-takers who never leave Apple Notes
  • Enterprises needing SOC2 day one
  • People who want Notion AI with no local files

Value proposition

Same Karpathy workflow. Obsidian still the front. Under the hood, a brain that stays fast when your life is 300k Telegram messages — and tags who promised what and what smells like a trap.


Differentiation

  1. Measured scale cliff — public A/B artifacts, not vibes.
  2. Obsidian-first GTM — easier pitch than “custom holographic IDE.”
  3. Redteam ontology — users / promises / traps as first-class wiki, not only chat search.
  4. Hybrid retrieval — semantic hologram + exact keyword for needles.
  5. Agent schema — AGENTS.md so tools behave like wiki maintainers, not chatbots.

Monetization ↔ PMF

Tier Who pays Why now
Free Distribution Learn Karpathy path; feel the cliff
Pro Individuals with fat corpora A/B shows scan latency; export + hologram is the fix
Hosted group Teams / rooms Isolation + shared demo narrative
Agent metered Other agents / apps High-margin cheap reads (roadmap)

No token required for product narrative.


Activation → retention loop

Connect TG or drop export
    → participated filter + full turns
    → raw md + redteam wiki + hologram
    → open Obsidian (A and/or B)
    → query plugin / brain.stacc.bio
    → lint traps & promises
    → live pull keeps it forward-looking
    → agent sessions file answers back

Aha moment: first query over “whole export” that returns in sub-ms index time and opens a real chat with both sides of the conversation.

Habit moment: trap/promise ledger catches something before a bad send / bad trust.


Metrics that prove PMF

North star

Weekly active brains that ran ≥1 successful query on a corpus ≥50k messages.

Input metrics

  • Exports completed / Telethon connects
  • Chats kept (conv-turn filter)
  • Plugin opens / hosted demo searches

Quality metrics

  • A/B p50/p95 (regressed if A wins latency on large N — bug)
  • Planted-needle R@1 for hybrid keyword path
  • % of queries with ≥1 click-through to raw chat

Business metrics

  • Free → Pro conversion after export size threshold
  • Hosted tenants with non-demo keys
  • Agent API call volume (later)

Risks

Risk Mitigation
Privacy / demo optics Label demo; private tenants default; no accidental public load of private TG
Telethon ToS / ban User-owned sessions; rate limits; document my.telegram.org
Hologram quality skepticism Hybrid keyword; publish A/B; abstain floors
Obsidian dependency Files remain portable; API works without Obsidian
Ops burden of hosted Single binary + Caddy; tenant isolation

Competitive landscape (short)

  • Karpathy gist clones — free, no scale story.
  • MindBase / OSS MCP wikis — md-native, agent-good, still file-scale.
  • Mem0/Zep — app memory, not Obsidian second brain.
  • We — Obsidian pitch + hologram scale + TG turns + redteam ledgers + hosted groups.

90-day PMF plan

Window Focus Exit criterion
Days 1–30 Stable demo + A/B public + dual vaults 10 operators open vault + run query
Days 31–60 Telethon connect UX for their accounts 5 users with live forward ingest
Days 61–90 Hosted private tenants + Pro cliff 3 paying or LOI group tenants

Decision log (grounded in build)

Decision Why
Obsidian as pitch, not pure custom IDE Easier GTM; user said so
Participated + full turns “Where I chatted” without channel noise; need both sides
Redteam users/promises/traps Adversarial ops value on TG-native users
Multi-export (DataExport_2025 + shebang) 463-folder dump was incomplete vs ~1.7k chat export
Hybrid retrieval Exact needles ≠ geometry
No token in product story User: we don’t care about $leOS here

One-paragraph PMF statement

Stacc Brain is for Telegram-native operators and agent users who already want a Karpathy llm-wiki in Obsidian but choke when raw is hundreds of thousands of messages. We keep the Obsidian face, store raw as full conversation turns, compile a users / promises / traps wiki, and serve a holographic index that is orders of magnitude faster than scanning the vault — with optional hosted multi-tenant demo and group brains. PMF is when those operators weekly query a ≥50k-msg brain instead of abandoning another markdown wiki.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment