Skip to main content

Leaxp

Leaxp

CI codecov PyPI Python License

Learn -> experience — a bridge sharing experience between agentic sessions. Package and distribute agent skills, knowledge, and experience as portable .xp files.

Leaxp gives every project a searchable knowledge database (.xp/ — Markdown records indexed by a small local embedding model) and exposes it to coding agents through three MCP tools: recall, expand, remember. Knowledge is learned by your own agent CLI (claude / codex) — no external LLM API, no keys. Smaller context, cheaper inference, model-agnostic.

Status: MVP — file-based installs work end-to-end; GitHub and registry sources are coming.

Install

pip install leaxp

That's it — search runs on a small local ONNX embedding model (fastembed); no torch, no services, no API keys.

Quickstart

exp use --with claude       # wire MCP + hooks, create .xp/, leaxp.toml, leaxp.lock
exp learn --goal "onboard new contributors"   # drive claude/codex to distill the codebase
exp share -o my-project.xp  # pack .xp/local/ into a shareable archive

# on another machine / project
exp install -f my-project.xp          # unpack into .xp/share/<name>/ + index
exp install -f my-project.xp --self   # ...or into .xp/local/ for editing
exp sync                              # reindex .xp/ after editing records by hand
exp exec "create stripe subscription" # print the raw recall output for a query
exp mcp                               # (run by your agent) serve recall/expand/remember

Once wired, agents get an initial memory recall on their first prompt and can:

  • recall(query, subquery?, limit?) — search records; returns scored titles + expected outcomes grouped into <package> blocks, low-relevance hits filtered out. Conventional records come fully expanded as <rule> entries in a separate <conventions> block.
  • expand(id | [ids]) — fetch full Markdown bodies, one record or several at once
  • remember(title, description, content, id?, convention?) — write or update knowledge; pass convention=true to record a one-paragraph rule that renders in full on every matching recall

Concepts

  • Record — one Markdown file with YAML frontmatter under .xp/local/ (git-tracked, yours) or .xp/share/<pkg>/ (installed, git-ignored). Record titles follow [action] [package|entity] [subject?] — e.g. create stripe subscription — so searches and titles speak the same language.
  • Convention — a record flagged convention: true: a one-paragraph rule (naming, structure, which tool/skill to use) that recall renders in full, no expand needed. Searched separately from regular records.
  • Indexindex.npy + index.json; exactly one vector per Markdown-heading breadcrumb (Stripe API > Webhooks > Error Handling), searched by cosine similarity with a relevance floor so agents never wade through noise. Recall groups results by package, labeling each with its description (from leaxp.toml for local, from the install manifest for shared packages).
  • .xp file — zip of record Markdown + a sha256-signed manifest. Embeddings are recomputed locally on install, so the same pack works with any embedding model.

Project structure

See CLAUDE.md for the package architecture overview and AGENTS.md for coding-agent ground rules. Release notes live in CHANGELOG.md; the release process in RELEASING.md.

Development

uv sync                                  # create venv, install deps
uv run pre-commit install                # enable hooks
uv run ruff check . && uv run pyright    # lint + typecheck
uv run pytest --cov                      # tests with coverage
uv run exp --help

License

Apache-2.0 — see LICENSE.txt.

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

leaxp-0.2.1.tar.gz (57.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

leaxp-0.2.1-py3-none-any.whl (62.1 kB view details)

Uploaded Python 3

File details

Details for the file leaxp-0.2.1.tar.gz.

File metadata

  • Download URL: leaxp-0.2.1.tar.gz
  • Upload date:
  • Size: 57.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.14

File hashes

Hashes for leaxp-0.2.1.tar.gz
Algorithm Hash digest
SHA256 5733bb229541c3baf6373893b8a5a3c4c23a47ba75291b1b05524161274fff62
MD5 4b2fcd9835b04fb61058130213f5ea10
BLAKE2b-256 35e31930e81dcc15c621ca3b359048ab7b4a6e38119f95115ff173c1f1dd6d80

See more details on using hashes here.

Provenance

The following attestation bundles were made for leaxp-0.2.1.tar.gz:

Publisher: release.yml on vunone/leaxp

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file leaxp-0.2.1-py3-none-any.whl.

File metadata

  • Download URL: leaxp-0.2.1-py3-none-any.whl
  • Upload date:
  • Size: 62.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.14

File hashes

Hashes for leaxp-0.2.1-py3-none-any.whl
Algorithm Hash digest
SHA256 3df6ec6328fdf90c4d55db3adc7cb25da5252e74d39913371f3c2532d0696dc0
MD5 9a6810f359d0fb3354103cb190db2172
BLAKE2b-256 5b371c7a43087a8a02cccf6e347674808b203dd7665f8c538b93b739fd729e9d

See more details on using hashes here.

Provenance

The following attestation bundles were made for leaxp-0.2.1-py3-none-any.whl:

Publisher: release.yml on vunone/leaxp

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Release history Release notifications | RSS feed

0.5.1

2 files

0.5.0

2 files

0.4.0

2 files

0.3.0

2 files

This release

0.2.1 This release

2 files

0.2.0

2 files

0.1.0

2 files

0.0.4

2 files

0.0.3

2 files

0.0.2

2 files

0.0.1

2 files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page