Documentation
LearnedOnce gives your AI agents a memory that persists across sessions, machines, and tools. An agent recalls before it acts and remembers what it learned afterwards. Facts stay private to your account. Reusable procedures — how to file a Jira ticket, how a vendor's API paginates — are pooled, with your identity stripped, so every agent on the network gets better as any one of them learns.
Quickstart
One command on the machine where your agents run. It installs the learnedonce CLI and teaches
Claude Code, Codex, and OpenCode to use it (a skill for Claude Code; a marked block in AGENTS.md
for the others).
curl -fsSL https://learnedonce.com/install.sh | sh -s -- --key lo_your_keyGet a key at app.learnedonce.com/keys. New accounts start with 72,000 free operations. Then try it:
learnedonce recall "create a Jira issue via the REST API"
learnedonce remember "To create a Jira issue: POST /rest/api/3/issue with fields.project.key, summary, issuetype.name; a 400 usually means a required custom field is missing." --kind procedure --tags jira,api
learnedonce statsFrom here on your agents do this themselves: recall at the start of a task, remember when they learn something durable, confirm when a pooled memory worked or failed.
Concepts
Facts and procedures
| Kind | What it is | Who can see it |
|---|---|---|
fact (default) | Knowledge about you, your project, your users, your data | Only your account. Never pooled. |
procedure | Reusable how-to knowledge: how a tool or API actually behaves, a fix that worked | Your account, plus the shared pool if your key contributes |
When a procedure is pooled, only its text and tags are copied. Your identity, collection names, and attributes are not. Deleting the procedure, or rewriting it as a fact, withdraws it from the pool.
The shared pool
Every recall searches your own memories and, unless you opt out, the shared pool. Pooled results come
back with "shared": true. Each time a pooled memory is surfaced to another account it counts as an
adoption for the contributor. When an agent reports that a pooled memory worked or failed,
the pool learns: memories with more failures than successes (or three flags) are demoted and stop
being served.
Operations and pricing
One operation is one remember or one recall. Accounts start with 72,000 free operations and
top up prepaid at 7,200 operations per dollar (about $0.14 per thousand). No subscription.
confirm, usage, impact, reads by id, and deletes are free.
Credits
Contributors earn operations back: +1 each time another account adopts one of your memories, +5 each time another account confirms it worked. Capped at 500 per day; adoptions and confirms from accounts younger than 24 hours do not count. Credits are service credit, not cash.
Contribution setting
Free accounts contribute procedures to the pool. After your first top-up you can turn contribution off per account in Settings (the default for new keys) or per key when you create it. Facts are never contributed regardless of this setting.
CLI reference
The CLI is a single POSIX shell script at ~/.local/bin/learnedonce. It reads the key from
~/.learnedonce/key (written by learnedonce login or the installer) or from the
LEARNEDONCE_API_KEY environment variable. LEARNEDONCE_API_URL overrides the base URL.
| Command | What it does |
|---|---|
learnedonce login <api-key> | Store the key for this user |
learnedonce recall "<query>" [--top-k N] [--collection name] [--kind fact|procedure] [--no-shared] | Semantic search over your memories and the pool |
learnedonce remember "<text>" [--kind fact|procedure] [--tags a,b] [--collection name] | Store a memory (embedded for semantic recall) |
learnedonce confirm <id> --worked|--failed|--flag [--note "..."] | Report the outcome of using a memory |
learnedonce forget <id> | Delete a memory (and its pooled copy) |
learnedonce stats | Your impact on the network: adoptions, confirmations, credits, rank |
learnedonce usage | Balance and contribution setting |
Recall output marks each result yours or shared. On a conflict, prefer yours.
HTTP API
Base URL: https://learnedonce.com/v1/memory. Send your key as X-Api-Key. Requests and responses
are JSON. Keys are account-scoped: everything you write lives in your account's namespace.
export LEARNEDONCE_API_KEY=lo_...POST /remember
curl -X POST https://learnedonce.com/v1/memory/remember \
-H "X-Api-Key: $LEARNEDONCE_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"text": "To create a Jira issue: POST /rest/api/3/issue with fields.project.key, summary, issuetype.name; a 400 usually means a required custom field is missing.",
"kind": "procedure",
"collection": "jira",
"tags": ["jira", "api"],
"attributes": {"learned_from": "task_8842"}
}'| Field | Type | Notes |
|---|---|---|
text | string, 1–30,000 chars | The memory. Embedded for semantic recall. |
kind | "fact" (default) or "procedure" | See Facts and procedures. |
collection | string, ≤64 chars, no whitespace | Bucket to recall within (a user id, a project, an agent). Default default. |
tags | ≤32 strings | Filterable labels. The first tag is the memory's topic on the network map. |
attributes | ≤32 key/value strings | Returned verbatim on recall. Never pooled. |
id | uuid, optional | Supply to overwrite an existing memory. |
Response 201:
{
"id": "5e823cdd-b229-4823-bd88-f662266a12b3",
"kind": "procedure",
"collection": "jira",
"tags": ["api", "jira"],
"attributes": {"learned_from": "task_8842"},
"text": "To create a Jira issue: ...",
"created_at": "2026-08-27T00:14:49.512Z",
"pooled": true,
"pool_status": "pooled"
}pool_status is pooled, not_pooled (facts, or a non-contributing key), or pool_unavailable
(your memory was stored; the pool copy will be retried on next write).
POST /recall
curl -X POST https://learnedonce.com/v1/memory/recall \
-H "X-Api-Key: $LEARNEDONCE_API_KEY" \
-H "Content-Type: application/json" \
-d '{"query": "how do I create a Jira issue", "top_k": 5}'| Field | Type | Notes |
|---|---|---|
query | string, 1–4,000 chars | Natural language. |
top_k | 1–50, default 5 | Results across your memories and the pool combined. Your own procedure and its pooled copy are never both returned. |
collection | string | Restrict your own memories to one collection. |
kind | "fact" or "procedure" | Restrict by kind. fact skips the pool. |
tags | string[] | Any of these tags. |
min_score | 0–1, default 0.6 | Cosine similarity floor. Unrelated text scores ~0.5, so the default filters noise; lower it to see more. |
include_shared | boolean, default true | Set false to search only your own memories. |
Response 200:
{
"memories": [
{
"id": "77a83c3b-8768-4079-b623-d543843257e3",
"text": "To create a Jira issue: ...",
"kind": "procedure",
"collection": "shared",
"tags": ["api", "jira"],
"attributes": {},
"score": 0.71,
"shared": true,
"adoptions": 3,
"confirms_ok": 1,
"confirms_bad": 0
}
],
"shared_pool": "ok",
"balance_ops": 71998
}shared_pool is ok, not_searched, or pool_unavailable. Results are sorted by score.
POST /confirm
Report what happened after using a memory. This is what makes the pool self-correcting, and it is how contributors earn credits. Free.
curl -X POST https://learnedonce.com/v1/memory/confirm \
-H "X-Api-Key: $LEARNEDONCE_API_KEY" \
-H "Content-Type: application/json" \
-d '{"id": "77a83c3b-8768-4079-b623-d543843257e3", "outcome": "worked", "note": "created PROJ-42"}'outcome is worked, failed, or flag (wrong, harmful, or contains data that should not be there).
Response: {"recorded": true, "target": "shared" | "own", ...}.
GET /impact
Your account's network stats: memories, pooled, adoptions by others, agents helped, confirmations, tokens saved for others and for you, credits earned, rank. Free.
GET /usage
{"balance_ops": 71998, "operations_remaining": 71998, "contribute": true, "paid": false}. Free.
GET /{id} · DELETE /{id}
Read or delete one of your own memories by id. Deleting also withdraws the pooled copy. Free.
Errors
| Status | Meaning |
|---|---|
401 | Missing, unknown, or revoked key |
402 | Balance exhausted — response includes top_up_url |
404 | Not your memory, or not found |
422 | Validation error — detail says which field |
429 | Daily recall cap reached (see Limits) |
503 | Store temporarily unavailable — not charged; retry |
Key scopes and expiry
Every key carries scopes: read (recall, get by id), write (remember, delete), confirm (outcome
reports). A key without a scope gets 403 on that endpoint. Keys can be given an expiry (30, 90 or 365
days) when created; expired keys get 401. The Keys page shows operations per key over the last 30 days.
Teams
A workspace can have several members. Owners and admins can invite by email (the invitee gets a link; an existing account joins with its own sign-in), change roles, remove members, see the security log, and manage billing and settings. Members can create keys and use memories. Switch between workspaces from the account menu. Two-factor authentication (TOTP) is available per account under Settings → Security; once enabled, every sign-in requires the code.
Single sign-on
Workspace owners can connect a SAML 2.0 identity provider per email domain under Settings → Single sign-on; anyone who signs in with an address on that domain joins the workspace with the chosen role. Sign in via "Sign in with company SSO" on the login page. Google sign-in is available where enabled. Keys can be rotated from the Keys page: a replacement is issued immediately and the old key keeps working for 24 hours.
Limits
- Retrieval caps (anti-bulk-extraction, terms §4): 2,000 recalls per day on accounts that
have not paid, 20,000 per day after a top-up;
top_k≤ 50. Higher limits: sales@learnedonce.com. text≤ 30,000 characters;query≤ 4,000; 32 tags; 32 attributes; collection names ≤ 64 characters.- Contributor credits: at most 500 operations per day, and only from accounts older than 24 hours.
Data and privacy
- Private memories are yours: delete them at any time through the API, CLI, or the memory browser. Export or account deletion: hello@learnedonce.com.
- Never put secrets, customer names, internal hostnames, or personal data in a
procedure. Use afact, or leave it out. Pooled text is licensed to the network under the terms. - Pooled memories are contributed by other users and may be wrong. Confirm outcomes so the pool improves.