Skip to main content

Single-file graph memory for local AI, agents, and Python applications

Project description

liel

License: MIT CI

The name comes from the French lier — to connect, to bind.

A portable external brain for local AI agents — one file, structured by relationships.

pip install liel
liel-demo

Runs fully local. No API keys required (LLM optional).

liel is a single-file graph memory layer for people using local AI agents while coding. One .liel file stores decisions, tasks, sources, files, facts, and the relationships between them, so tools can recall why decisions were made, not just what was said.

The core is a small Rust property graph engine with Python (PyO3) bindings and optional MCP tools. No server, no cloud, no daemon.

Why Local-First

  • Your code stays on your machine. No API keys, no telemetry, no cloud round-trips.
  • Works with any LLM. Local (Ollama, LM Studio) or cloud (Claude, GPT) — only memory stays local.
  • Offline-friendly. Memory persists across sessions without network access.
  • One file, no lock-in. Copy, commit, archive, and open with any tool that speaks .liel.

Try It

import liel

with liel.open("agent-memory.liel") as db:
    task = db.add_node(
        ["Task"],
        description="Migrate auth from JWT to server-side sessions",
    )
    question = db.add_node(
        ["OpenQuestion"],
        content="Use Redis or PostgreSQL for the session store?",
    )
    rejected = db.add_node(
        ["RejectedOption"],
        option="Redis",
        reason="Adds another infrastructure dependency",
    )
    decision = db.add_node(
        ["Decision"],
        content="Use a PostgreSQL session table",
    )
    source = db.add_node(["Source"], title="Auth migration notes")

    db.add_edge(task, "RAISED", question)
    db.add_edge(question, "REJECTED", rejected)
    db.add_edge(question, "RESOLVED_BY", decision)
    db.add_edge(decision, "SUPPORTED_BY", source)
    db.commit()

    for node in db.neighbors(question, edge_label="RESOLVED_BY"):
        print(node["content"])

Use it as Claude/Cursor project memory via MCP: see the MCP guide.

Compared To Mem0 / Letta / Zep

liel is intentionally lower-level and local-first. It ships as a single .liel file with no server, no API keys, and no required vector index. Relationships are explicit edges you write and traverse, not only facts inferred from chat history.

Mem0, Letta, and Zep may be a better fit when you want a hosted service, a full agent runtime, automatic memory extraction, temporal graph intelligence, dashboards, or production-scale context assembly. liel is the smaller substrate: local coding agents and project-adjacent tools that need durable, inspectable graph memory they can copy, commit, archive, and open from Python or MCP.

The Zen of Liel

  • One file, any place.
  • No server, no waiting.
  • Minimal dependencies, simple environments.
  • Start small, stay local.

Documentation

Status

liel is currently a Beta package. The supported contract is the Python-first API plus the single-writer, single-file reliability model. There is no semantic/vector search in core, and commit() defines crash-safe boundaries. Breaking changes before 1.0 are tracked in the changelog.

Contributing

Pull requests and issues are welcome. A good first step is to run liel-demo and note anything confusing about the output, memory model, or docs.

See CONTRIBUTING.md.

Author

Built by Hayato under hy-token, a personal namespace for small local-first tools and AI infrastructure experiments.

License

MIT

Project details


Download files

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

Source Distribution

liel-0.2.10.tar.gz (135.9 kB view details)

Uploaded Source

Built Distributions

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

liel-0.2.10-cp39-abi3-win_amd64.whl (353.8 kB view details)

Uploaded CPython 3.9+Windows x86-64

liel-0.2.10-cp39-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (496.7 kB view details)

Uploaded CPython 3.9+manylinux: glibc 2.17+ x86-64

liel-0.2.10-cp39-abi3-macosx_11_0_arm64.whl (447.9 kB view details)

Uploaded CPython 3.9+macOS 11.0+ ARM64

File details

Details for the file liel-0.2.10.tar.gz.

File metadata

  • Download URL: liel-0.2.10.tar.gz
  • Upload date:
  • Size: 135.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for liel-0.2.10.tar.gz
Algorithm Hash digest
SHA256 7b4fcd9b458c9c02773c9a762ad12fbfcb7d1b6fe94d833e19ecfc6fda608edc
MD5 46b0a129695ae5f23db05d989a6eaeb1
BLAKE2b-256 da663e74f6c49a784e1797635467e3f6486019ece3a27e97e0cc186eb85528c6

See more details on using hashes here.

Provenance

The following attestation bundles were made for liel-0.2.10.tar.gz:

Publisher: release-pypi.yml on hy-token/liel

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

File details

Details for the file liel-0.2.10-cp39-abi3-win_amd64.whl.

File metadata

  • Download URL: liel-0.2.10-cp39-abi3-win_amd64.whl
  • Upload date:
  • Size: 353.8 kB
  • Tags: CPython 3.9+, Windows x86-64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for liel-0.2.10-cp39-abi3-win_amd64.whl
Algorithm Hash digest
SHA256 669967517157d6d6a4e197a76ecd86e97aa193a1f49bf23dee535f4adc474e18
MD5 9b3075af57449cfe94b3694a3bf44a15
BLAKE2b-256 8b8b1a07b843aec7f817cf55deec081973e15b5cdaf7d5bbdea27807481bf57c

See more details on using hashes here.

Provenance

The following attestation bundles were made for liel-0.2.10-cp39-abi3-win_amd64.whl:

Publisher: release-pypi.yml on hy-token/liel

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

File details

Details for the file liel-0.2.10-cp39-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for liel-0.2.10-cp39-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 14fb22fe50bed90d5356baf1b8e9f430dfbff328a28f0c7133db73b5044b4a7e
MD5 ca1bb8a274eac5d0759a342d74649a67
BLAKE2b-256 05238b1207c0e3dd9825c28ec82133f704f0a843976fe2798c00d9efec01ab6f

See more details on using hashes here.

Provenance

The following attestation bundles were made for liel-0.2.10-cp39-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl:

Publisher: release-pypi.yml on hy-token/liel

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

File details

Details for the file liel-0.2.10-cp39-abi3-macosx_11_0_arm64.whl.

File metadata

  • Download URL: liel-0.2.10-cp39-abi3-macosx_11_0_arm64.whl
  • Upload date:
  • Size: 447.9 kB
  • Tags: CPython 3.9+, macOS 11.0+ ARM64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for liel-0.2.10-cp39-abi3-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 31b643139215e58189a052dbb23d164be772f657d2ba30200f0a4d055b0c09a6
MD5 1961eb13f67662dd414a3e418f4960a6
BLAKE2b-256 45a3336fbe557bbcc595a7fb467329f7194f71ed4d998d0af91288915de5a077

See more details on using hashes here.

Provenance

The following attestation bundles were made for liel-0.2.10-cp39-abi3-macosx_11_0_arm64.whl:

Publisher: release-pypi.yml on hy-token/liel

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

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page