Skip to main content

๐Ÿง  Eling

Lightweight memory, powerful retrieval โ€” 5-tier second brain for AI agents

HRR reasoning ยท 3 MCP servers (41 tools) ยท Continuum Layer 6 multi-agent orchestration hub ยท temporal queries ยท per-fact versioning ยท vector search ยท Zettelkasten linking ยท memory evolution ยท spec-kit verification ยท conditional + universal verify-on-stop ยท ELING_HOME override ยท handshake agent auto-attribution ยท full-page retrieval (eling_get_page_full) ยท FactMemoryProvider

"Eling" (Javanese): to remember, to be conscious, to be aware

PyPI Python 3.10+


โœจ What is Eling?

Eling is a lightweight, unified second brain for AI agents. It merges 5 memory tiers via three MCP servers โ€” and adds a Continuum Layer 6 orchestration tier that turns eling into a shared hub for multiple AI coding agents. No external databases, no cloud services needed for local operation (though it optionally syncs to Notion for human readability).

Think of it as one memory stack that serves both the agent and the human โ€” and one orchestration hub that serves every agent you run:

๐Ÿง  Layer 6: CONTINUUM โ€” multi-agent orchestration hub (shared continuum.db, 15 continuum_* tools)
๐Ÿง  Tier 5: NOTION   โ€” online brain, persistent, human-readable (optional)
๐Ÿ“š Tier 4: KB       โ€” FTS5 knowledge corpus for long-form knowledge
๐Ÿ•ธ๏ธ Tier 3: CODE     โ€” codegraph symbol intelligence
๐Ÿ’Ž Tier 2: FACTS    โ€” SQLite + HRR + BM25 hybrid with trust scoring
๐Ÿ“Œ Tier 1: BUILTIN   โ€” Hermes MEMORY.md / USER.md (always-on prompt context)

How the tiers work together

Tier What it stores How it's queried Persistence
๐Ÿง  Notion Permanent pages, project plans, vault entries eling_reflect promotes facts; eling_sync push syncs Cloud โ€” human-viewable, survives everything
๐Ÿ“š KB Articles, docs, long-form knowledge chunks FTS5 full-text search Local SQLite โ€” persistent
๐Ÿ•ธ๏ธ Code Function symbols, imports, class hierarchies Codegraph traversal Local SQLite โ€” auto-indexed
๐Ÿ’Ž Facts Short facts, preferences, observations HRR + BM25 + trigram hybrid with trust scores Local SQLite โ€” append-only, versioned
๐Ÿ“Œ Builtin Agent identity, user profile, conventions Always in prompt context (MEMORY.md / USER.md) Hermes config files

๐Ÿง  Notion as Online Memory

Tier 5 (Notion) is what makes eling human-readable. While tiers 1โ€“4 live locally as SQLite databases, Tier 5 optionally syncs high-trust facts to your Notion vault as permanent, well-formatted pages:

  • eling_reflect <fact_id> โ€” promote a high-trust fact to a Notion page
  • eling_sync --direction push โ€” batch-sync all high-trust facts to Notion
  • eling_sync --direction pull โ€” pull Notion pages back into the knowledge base
  • eling_sync --direction all โ€” bidirectional sync

This gives you a recoverable brain: even if your local SQLite databases are lost, your Notion vault retains the curated facts and permanent knowledge. The opinionated vault structure keeps the main page as a clean index of credential children, with all log entries auto-routed to a dedicated child page.

๐Ÿš€ Quick Start

pip install eling

# Run the Notion-only MCP server (online/remote memory, 6 tools)
python3 -m eling mcp

# Run the local-layers MCP server (facts, KB, code, builtin, HRR โ€” 20 tools)
python3 -m eling.as_brain.mcp_server
# or
eling as-brain

# Run the Continuum Layer 6 orchestration hub (multi-agent, 15 continuum_* tools)
python3 -m eling continuum mcp
# or
eling-continuum

# Use the CLI
python3 -m eling --help

# If using OpenCode, install the lifecycle plugin:
eling-install-opencode

๐Ÿ”Œ Agent Integration

Agent Integration Status
Hermes MCP (Notion eling + local as_brain + Continuum continuum) + Memory Provider + Plugin โœ… Tested
OpenCode MCP (all 3 servers) + Lifecycle Plugin โœ… Tested
MiMo-Code MCP (all 3 servers, OpenCode fork) โœ… Tested
Zero MCP (all 3 servers) + Hooks + Skill โœ… Bundled installer
Claude Code MCP (all 3 servers via mcpServers) โœ… Wiring provided
Codex MCP (all 3 servers via mcp_servers) โœ… Wiring provided

One shared hub for every agent (Continuum Layer 6)

Continuum turns eling into a single MCP hub that all your coding agents connect to. Each agent gets isolated git worktrees, a shared orchestration registry, and two-tier knowledge (fundamental = binding rules, situational = semantic search) โ€” all routed through eling's memory. Every entry is auto-attributed by the agent's MCP handshake name, so you always know which agent wrote what.

Wire all six agents in one command (Hermes, OpenCode, MiMo-Code, Zero, Claude Code, Codex):

# from the eling repo
chmod +x continuum/install.sh
continuum/install.sh --eling-home /shared/eling     # shared store for all agents
continuum/healthcheck.sh --eling-home /shared/eling # verify every agent is wired

Per-agent configs live in continuum/configs/; uninstall with continuum/uninstall.sh. See continuum/README.md for the full guide.

Non-tested agents connect via the stdio MCP servers โ€” any MCP-compatible host can use eling (notion-only, 6 tools), as_brain (local layers, 20 tools), and continuum (orchestration hub, 15 continuum_* tools).

Hermes

Eling plugs into Hermes Agent at 3 levels:

1. MCP Server โ€” add to ~/.hermes/config.yaml:

mcp_servers:
  eling:
    command: python3
    args: ["-m", "eling.mcp_server"]
    enabled: true

2. Memory Provider โ€” sets default brain for remember/recall:

memory:
  provider: eling

3. Plugin โ€” registers eling_remember + eling_recall as quick tools:

plugins:
  enabled:
    - eling
  eling:
    home: /root/.eling

OpenCode

Eling provides an OpenCode lifecycle plugin that auto-writes session memory:

# After installing eling, run this to install the plugin:
eling-install-opencode

# Or:
python3 -m eling install-opencode

This copies eling-memory.js to OpenCode's plugin directory and registers it in opencode.jsonc. The plugin hooks into:

  • chat.message โ€” stores user prompts as facts
  • tool.execute.after โ€” stores tool observations as facts
  • event (session.idle / session.compacted) โ€” pushes high-trust facts to Notion

The eling MCP server should also be configured in OpenCode (opencode.jsonc):

"mcp": {
  "eling": {
    "type": "local",
    "command": ["python3", "-m", "eling.mcp_server"],
    "enabled": true
  }
}

Zero

Eling provides a one-command installer for Zero terminal agent โ€” hooks + skill + MCP in one go:

# After installing eling:
eling-install-zero
# Or:
python3 -m eling install-zero
# Preview without changes:
python3 -m eling install-zero --dry-run

This sets up:

Component What it does
MCP Server Adds eling to Zero's config.json โ†’ all 22 tools available
Hooks (4) Registers lifecycle hooks for auto-memory
Skill Installs a SKILL.md that teaches Zero about eling's tools

Hook mapping

Zero Event Eling action
sessionStart Warm caches, log session info
beforeTool Recall relevant context for the tool
afterTool Store file edits + tool results as facts
sessionEnd Flush memory to disk, push to Notion

Manual config

If you prefer to wire it up yourself, add the MCP server to Zero's ~/.config/zero/config.json:

"mcp": {
  "eling": {
    "command": "python3",
    "args": ["-m", "eling.mcp_server"]
  }
}

๐Ÿ“‹ CLI Commands

python3 -m eling remember   "I learned that..."
python3 -m eling recall     "what did I learn about X"
python3 -m eling probe      "X"
python3 -m eling reason     ["X", "Y"]
python3 -m eling reflect    1                 # promote fact_id 1 to Notion
python3 -m eling verify                        # query verification status
python3 -m eling verify-spec                   # run spec-kit conformance

# Memory version control (v0.5.1)
python3 -m eling snapshot  --reason "pre_evolution"  # snapshot facts DB
python3 -m eling list-snapshots                       # list all snapshots
python3 -m eling rollback  <snapshot_id>              # restore to snapshot

# Zettelkasten linking + evolution
python3 -m eling link-stats                    # link graph stats
python3 -m eling linked-facts 1                # facts linked to fact_id 1
python3 -m eling evolve                        # merge near-duplicate facts
python3 -m eling stats
python3 -m eling export     --format markdown
python3 -m eling sync       --direction push   # facts โ†’ Notion

# Agent integration
python3 -m eling install-opencode              # install OpenCode lifecycle plugin
python3 -m eling install-zero                  # install Zero hooks + skill + MCP
python3 -m eling init-rules                    # write steering rules for AI agents

# Temporal search (v0.6.0)
python3 -m eling search-temporal "last 3 days" --category testing
python3 -m eling search-temporal "kemarin"     # Indonesian language support

# Per-fact versioning (v0.6.0)
python3 -m eling versioned-update 1 "Updated content" --reason "correction"
python3 -m eling version-history 1
python3 -m eling undo-to-version 1 --version-id 0
python3 -m eling versioning-stats

๐ŸŒ Notion Setup (Tier 5)

Optional โ€” skip this if you only need local memory.

  1. Create a Notion integration at https://www.notion.so/my-integrations

    • Give it a name (e.g. "Eling Brain")
    • Copy the Internal Integration Secret (starts with ntn_)
  2. Share a parent page with your integration

    • Open the page you want as your second brain root
    • Click Share โ†’ Invite โ†’ select your integration
    • Copy the page URL and extract the page ID (the UUID in the URL, e.g. 38f7b66e-c7e0-813f-85b0-d37cef59c1f7)
  3. Set environment variables:

export NOTION_API_KEY="ntn_..."
export NOTION_PARENT_PAGE_ID="38f7b66e-c7e0-813f-85b0-d37cef59c1f7"

Note-taking behavior

Once configured, eling auto-creates a ๐Ÿ“‹ Task Logs child page under your parent on first use:

๐Ÿ“‹ Hermes Vault (parent page โ€” your configured root)
  โ”œโ”€โ”€ ๐Ÿ“‹ Task Logs        โ† auto-created by eling
  โ”‚   โ”œโ”€โ”€ ๐Ÿ’ก Eling test โ† child pages from eling_reflect / remember(layer="notion")
  โ”‚   โ””โ”€โ”€ ๐Ÿ’ก Another note
  โ”œโ”€โ”€ ๐Ÿ”‘ API Keys...
  โ””โ”€โ”€ ...

Two ways to add notes to Notion:

Method Usage Route
brain.reflect(fact_id) / eling_reflect Promote a high-trust fact to Notion โ†’ auto-routes by category
brain.remember("text", layer="notion") / eling_remember with layer=notion Store content directly as a Notion page โ†’ auto-routes by category

Auto-routing by category

Content is automatically detected and routed to the right child page:

Category Triggers Child page
project_summary "project done/complete/selesai", "deploy success", "summary completion" ๐ŸŽฏ Project Summaries
credential "api_key", "password", "secret", "token", "credential" ๐Ÿ”‘ Credentials
address "alamat", "address", "domicile", "tinggal di" ๐Ÿ“ Addresses
config "config", "setup", "setting", "environment" โš™๏ธ Configurations
(uncategorised) Everything else ๐Ÿ“‹ Task Logs

Example:

# Auto-routes to ๐ŸŽฏ Project Summaries
b.remember("Project done, deployed to production", layer="notion")
# Auto-routes to ๐Ÿ”‘ Credentials
b.remember("DATABASE_URL = postgres://...", layer="notion")
# Auto-routes to ๐Ÿ“‹ Task Logs (no pattern match)
b.remember("General note", layer="notion")

All child pages under these category pages are full Notion pages โ€” you can edit, move, share, or reference them normally.

Or pass them explicitly in code:

from eling.brain import Brain
b = Brain(
    notion_api_key="ntn_...",
    notion_parent_id="38f7b66e-..."
)
result = b.reflect(fact_id=1)
print(result)  # {"page_id": "...", "promoted": True}

# Or store directly as a note
result = b.remember("Quick note for Notion", layer="notion")
print(result)  # {"layer": "notion", "page_id": "...", ...}

Note: eling_reflect and remember(layer="notion") check availability at call time and return a clear error if any config is missing โ€” no silent failures.

๐Ÿ•’ Temporal Search & Per-Fact Versioning (v0.6.0)

Eling v0.6.0 introduces time-aware fact retrieval and append-only per-fact versioning โ€” never lose a piece of knowledge again.

Temporal Search

Query facts by time range using natural language โ€” English or Indonesian:

python3 -m eling search-temporal "last 3 days"
python3 -m eling search-temporal "this week"
python3 -m eling search-temporal "kemarin"        # Indonesian: yesterday
python3 -m eling search-temporal "hari ini"       # today

Supported patterns:

Language Examples
๐Ÿ‡ฌ๐Ÿ‡ง English today, yesterday, this week, last month, last 3 days, last 7 days, last 30 days
๐Ÿ‡ฎ๐Ÿ‡ฉ Indonesian hari ini, kemarin, minggu ini, bulan lalu, 3 hari terakhir, 7 hari terakhir, 30 hari terakhir

Python API:

from eling.brain import Brain
b = Brain()

# Temporal search - English
results = b.search_temporal("last 3 days", category="testing")

# Indonesian
results = b.search_temporal("kemarin")

# All facts in a time window
results = b.search_temporal("", since_days=7)

Per-Fact Versioning

Every fact update is append-only โ€” old versions are preserved in a fact_versions table:

# Update a fact โ€” previous content is versioned
result = b.versioned_update(1, "Newer content", reason="corrected typo")
# โ†’ {"fact_id": 1, "version_id": 2, "previous": "Old content", "new": "Newer content"}

# Get version history
history = b.get_version_history(1)
# โ†’ [{"version_id": 0, "content": "Original...", "changed_at": "...", "reason": "initial"},
#     {"version_id": 1, "content": "Updated...", "changed_at": "...", "reason": "corrected typo"}]

# Undo to a specific version (also versioned!)
result = b.undo_to_version(1, version_id=0)
# โ†’ {"fact_id": 1, "version_id": 3, "restored_from": 0}

# Versioning stats
stats = b.versioning_stats()
# โ†’ {"versioned_facts": 42, "total_versions": 156, "version_operations": 114}

Available as MCP tools: eling_versioned_update, eling_get_version_history, eling_undo_to_version, eling_versioning_stats.

๐Ÿง  Memory Version Control (v0.5.1)

Eling provides Git-like snapshot and rollback for your facts database:

# Before destructive ops, create a snapshot
python3 -m eling snapshot --reason "pre_evolution"

# List available snapshots
python3 -m eling list-snapshots

# Rollback to a previous state (auto-backups current DB first)
python3 -m eling rollback 20260703-120000-123

Snapshots are file-level copies managed via snapshot.py. Available as MCP tools: eling_snapshot, eling_list_snapshots, eling_rollback.

๐ŸŽฏ Steering Rules (v0.5.1)

Teach your AI agent when to use eling's MCP tools. Auto-detects Cursor, Claude Code, OpenCode, Kiro, and Gemini:

cd your-project
python3 -m eling init-rules

This writes:

  • Cursor: .cursor/rules/eling-memory-*.mdc
  • Claude Code: .claude/rules/eling-memory-*.md
  • OpenCode: Appends to AGENTS.md
  • Generic: ELING_MEMORY.md in project root

Rules cover: when to store/retrieve memories, session lifecycle, and memory hygiene.

๐Ÿ” Vector Embeddings (v0.5.1)

Optional semantic search via sentence-transformers:

pip install eling[embeddings]
# or
pip install eling[all]

Enable when creating a Brain or set ELING_EMBEDDING_MODEL:

from eling.brain import Brain
b = Brain(embedding_model="all-MiniLM-L6-v2")

Hybrid search ranking: BM25 + Jaccard + HRR + cosine similarity from embeddings. Stored in a separate fact_embeddings table.

๐Ÿ›ก๏ธ Verify-on-Stop (Conditional + Universal)

Eling provides verify-on-stop nudges for AI agents that lack built-in verification (e.g., OpenCode, OpenClaw, Cursor, Windsurf). When running under Hermes, this feature automatically skips โ€” because Hermes already has its own agent/verification_stop.py.

Universal mode โ€” one shared brain for every agent

The as_brain MCP server can act as a universal brain for all connected agents at once. Set ELING_VERIFY_ALL_AGENTS=1 to force eling's verify-on-stop to stay active for every agent โ€” including Hermes โ€” so the shared brain provides verification regardless of harness. The default (unset) keeps the original behaviour: Hermes skips eling's nudges and relies on its own built-in verification.

# Run the shared brain with verification for ALL agents
ELING_VERIFY_ALL_AGENTS=1 python3 -m eling.as_brain.mcp_server

This powers multi-agent setups (e.g. Hermes + OpenCode + Zero sharing one as_brain instance) where you want a single source of truth for verification evidence.

How it works

  1. Auto-detection โ€” Eling detects the host agent from the MCP client's initialize handshake (clientInfo.name), which is more reliable than environment variable heuristics (prevents false Hermes detection when OpenCode runs under Hermes)
  2. Agent auto-attribution โ€” The handshake client name becomes the default source for brain_remember, so each agent's memories are tagged with its own identity without manual configuration (override with an explicit source argument)
  3. File edit tracking โ€” When code files are edited via hooks or MCP tools, eling records them in a verification ledger
  4. Spec-kit conformance โ€” If the project has spec-kit artifacts (specs/*/spec.md), eling checks whether code changes cover each spec requirement and includes gaps in the nudge
  5. Verification nudge โ€” If code was edited but no passing tests/verification was recorded, eling produces a [System: ...] nudge message
  6. Recording โ€” Agents can call brain_verify MCP tool (as_brain server) to record verification results (passed, failed, skipped)

Spec-kit Verification

Projects using spec-kit (Spec-Driven Development) get automatic spec conformance checking:

  • Eling detects specs/<feature>/spec.md, plan.md, and tasks.md artifacts
  • Requirements are extracted from spec markdown and matched against code files
  • The eling_verify_spec tool returns coverage stats + uncovered requirements
  • The standard eling_verify tool includes spec-kit results when spec_check=true
  • Uncovered requirements are listed in the verification nudge for the agent to address

Usage via MCP

// Query current status
{ "method": "tools/call", "params": { "name": "eling_verify", "arguments": {} } }

// Record a passing verification
{ "method": "tools/call", "params": {
    "name": "eling_verify",
    "arguments": { "status": "passed", "command": "pytest", "output": "364 passed" }
} }

// Run spec-kit conformance check
{ "method": "tools/call", "params": {
    "name": "eling_verify_spec",
    "arguments": { "changed_files": ["src/main.py"] }
} }

// Combine both: verify + spec-kit
{ "method": "tools/call", "params": {
    "name": "eling_verify",
    "arguments": { "spec_check": true }
} }

Config

Key Default Env Description
verify_on_stop true ELING_VERIFY_ON_STOP Enable nudges for non-Hermes agents
verify_on_stop_max_attempts 2 ELING_VERIFY_MAX_ATTEMPTS Max nudges per session
adapter hermes ELING_ADAPTER Force adapter type
home $HERMES_HOME/eling ELING_HOME Data directory for the universal brain (as_brain server)
verify_all_agents false ELING_VERIFY_ALL_AGENTS Universal mode: provide verify-on-stop for ALL agents incl. Hermes
plugins:
  eling:
    adapter: auto       # auto-detect from env
    verify_on_stop: true

๐Ÿ—๏ธ Architecture

eling/
โ”œโ”€โ”€ mcp_server.py          โ€” JSON-RPC stdio server (Notion-only, 5 tools: eling_*)
โ”œโ”€โ”€ as_brain/
โ”‚   โ””โ”€โ”€ mcp_server.py      โ€” JSON-RPC stdio server (local brain, 20 tools: brain_*)
โ”œโ”€โ”€ brain.py               โ€” Orchestrator: routing + RRF fusion + sync + linking
โ”œโ”€โ”€ config.py              โ€” Layered config: env โ†’ json โ†’ defaults
โ”œโ”€โ”€ hooks.py               โ€” 15 lifecycle hooks + HookRegistry + evolution
โ”œโ”€โ”€ verify_on_stop.py      โ€” Verification ledger + nudge builder + spec-kit wiring
โ”œโ”€โ”€ spec_kit.py            โ€” Spec-kit artifact parser + coverage analyzer
โ”œโ”€โ”€ privacy.py             โ€” PII/secret stripping (19 patterns)
โ”œโ”€โ”€ compress.py            โ€” SHA-256 dedup + length compression
โ”œโ”€โ”€ cli.py                 โ€” CLI client (install-zero wires BOTH MCP servers)
โ”œโ”€โ”€ fact_memory_provider.py โ€” Standalone facts layer provider (no Brain dependency)
โ””โ”€โ”€ layers/
    โ”œโ”€โ”€ builtin.py    โ€” Tier 1: Hermes MEMORY.md / USER.md loader
    โ”œโ”€โ”€ facts.py      โ€” Tier 2: SQLite + HRR + BM25 + trust + linking + evolution
    โ”œโ”€โ”€ hrr.py        โ€” Holographic Reduced Representations (optional numpy)
    โ”œโ”€โ”€ code.py       โ€” Tier 3: CodeLayer wrapper
    โ”œโ”€โ”€ code_index.py โ€” Pure-Python AST+regex code indexer
    โ”œโ”€โ”€ kb.py         โ€” Tier 4: FTS5 + porter + trigram + RRF
    โ””โ”€โ”€ notion.py     โ€” Tier 5: httpx Notion API client (lazy import)

โšก Performance

  • Lazy imports โ€” numpy and httpx are imported only when their layer is first used, not at module load time
  • import eling takes ~1.3s (was ~4.5s with module-level imports on Alpine)
  • Pure-Python fallback when numpy unavailable (BM25-only retrieval still works)

๐Ÿ“– Documentation

๐Ÿค Credits

  • HRR phase encoding + facts layer โ€” adapted from holographic plugin by dusterbloom (Hermes PR #2351, MIT)
  • Spec-kit integration โ€” spec-driven development artifacts (spec-kit by GitHub, MIT)

๐Ÿ“œ License

MIT ยฉ 2026 PatrickNoFilter

Download files

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

Source Distribution

eling-0.9.1.tar.gz (153.2 kB view details)

Uploaded Source

Built Distribution

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

eling-0.9.1-py3-none-any.whl (128.5 kB view details)

Uploaded Python 3

File details

Details for the file eling-0.9.1.tar.gz.

File metadata

  • Download URL: eling-0.9.1.tar.gz
  • Upload date:
  • Size: 153.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.13

File hashes

Hashes for eling-0.9.1.tar.gz
Algorithm Hash digest
SHA256 db1ed01ecfd1018953122c7def6e7bdb853085d5afe0f5b0f1b7c56c2fd79114
MD5 6239ef01575d537e7f3a28d687defa50
BLAKE2b-256 78ce022cdca114c7cba2d0eb77648ccb9a3253023ec966387c71323f24fb267b

See more details on using hashes here.

File details

Details for the file eling-0.9.1-py3-none-any.whl.

File metadata

  • Download URL: eling-0.9.1-py3-none-any.whl
  • Upload date:
  • Size: 128.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.13

File hashes

Hashes for eling-0.9.1-py3-none-any.whl
Algorithm Hash digest
SHA256 e285a377fdc370e13180026b3c761f42adc07defe9abe284f327032871e10dc8
MD5 1af029844872824d3a35f3ff9637a4a6
BLAKE2b-256 16779261941ff99bfbaea6cea2b39a4a3e33244b8bdaf1c64284af86416606cd

See more details on using hashes here.

Supported by

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