Banyan.Core 0.1.0-alpha.1

This is a prerelease version of Banyan.Core.
The owner has unlisted this package. This could mean that the package is deprecated, has security vulnerabilities or shouldn't be used anymore.
dotnet add package Banyan.Core --version 0.1.0-alpha.1
                    
NuGet\Install-Package Banyan.Core -Version 0.1.0-alpha.1
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="Banyan.Core" Version="0.1.0-alpha.1" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Banyan.Core" Version="0.1.0-alpha.1" />
                    
Directory.Packages.props
<PackageReference Include="Banyan.Core" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add Banyan.Core --version 0.1.0-alpha.1
                    
#r "nuget: Banyan.Core, 0.1.0-alpha.1"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package Banyan.Core@0.1.0-alpha.1
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=Banyan.Core&version=0.1.0-alpha.1&prerelease
                    
Install as a Cake Addin
#tool nuget:?package=Banyan.Core&version=0.1.0-alpha.1&prerelease
                    
Install as a Cake Tool

English | 中文版

🌳 Banyan

A memory node for AI agents — speaks the NPS wire protocol, stores everything in SQLite, runs entirely offline.

License Status

Banyan is an event-sourced memory store that agents can Remember(), Search(), Update() and Forget() against. The wire protocol is NPS-3 — Neural Web Protocol Memory-Node middleware via NPS.NWP, identity via Ed25519 NIDs from the NIP CA, and a parallel OIDC track for human operators on top of OLS.


Features

  • Hybrid retrieval — BM25 (FTS5) + ONNX vector search + RRF fusion. Vector index uses sqlite-vec ANN when available, falls back to in-memory cosine.
  • Real semantic embeddings — pluggable IEmbedder; ships with bge-small-zh-v1.5 (multilingual, 22 MB INT8 ONNX, 384-dim) plus an offline hashing fallback.
  • Dual-track identity
    • Agents / Memory Nodes: Ed25519 NID certificates issued by an embedded NipCaService or a remote nip-ca-server. Banyan ships the NPS-3 §8 conformant HTTP routes that the NPS.NIP NuGet hasn't shipped yet.
    • Operators / Admins: OIDC + JWT via OLS, with a SQLite-backed implementation of every Identity / OAuth store interface. The web UI enforces login via redirect when identity is configured.
  • Real NID authentication in LiteAuthorization: NID <base64(IdentFrame)> middleware with three modes (anonymous-allowed / writes-required / all-required). Server-side verified NID overrides any client-supplied agentNid; revocations from the CA take effect immediately.
  • Event-sourced memory — every Write/Update/Forget appends to an immutable log; the latest snapshot lives in memories_current; trace stays auditable even after forget.
  • Standards-compliant Memory Nodebanyan serve mounts app.UseMemoryNode<TProvider>, exposes /.nwm (NeuralWebManifest), /.schema, POST /api/memory/query (NWP frames with anchor_ref, token_est, etc.).
  • Web UI — neon-glass, particle-network background, three-tab SPA (Memory · Agents · About). Requires login when identity is configured; anonymous memory reads/writes remain available via the API without a session.
  • MCP Serverbanyan mcp runs as a Model Context Protocol stdio server, giving Claude Desktop and Claude Code four first-class memory tools (recall, remember, update, forget) with zero system-prompt boilerplate.
  • Single-binary CLIdotnet tool install -g Banyan.Cli ships the entire surface (keygen, init, login, ca init, agent issue/verify/revoke, embedder download, mcp, web, serve).

Quick Start

# 0. Install
dotnet tool install -g Banyan.Cli

# 1. Pull the embedder model + sqlite-vec extension (~24 MB)
banyan embedder download

# 2. Bootstrap human-side identity (creates admin account and JWT signing key)
banyan keygen
banyan init

# 3. Bootstrap the NID CA (skip if using an external CA server)
export BANYAN_NIP_CA_PASSPHRASE='your-passphrase'
banyan ca init

# 4. Issue an agent certificate
banyan agent issue --id summarizer-01 --cap memory.read,memory.write \
  --key-out ~/.banyan/agents/summarizer-01.key

# 5. Start the web UI
export BANYAN_EMBEDDER=onnx
banyan web
# → open http://localhost:5180
# → redirects to /login.html when identity is configured (step 2)
# → sign in with the admin account to access agent management and CA ops
# → without step 2, memory reads/writes work anonymously via the API

# To connect to an external nip-ca-server instead of the embedded one:
banyan web --no-ca \
  --trusted-issuer "urn:nps:ca:<ca-nid>=ed25519:<ca-pubkey>" \
  --ocsp-url http://your-ca-host:17435/ocsp

# 6. Enable NID authentication (writes-required is the common production setting)
banyan web   --nid-auth writes-required
banyan serve --nid-auth writes-required
# POST/PUT/DELETE/PATCH require Authorization: NID <base64(IdentFrame)>; reads stay open

# 7. Or run as a pure NWP Memory Node (no web UI)
banyan serve --allow-anon
# → POST /api/memory/query with QueryFrame body
# → GET  /.nwm for the NeuralWebManifest

# 8. Remote CA: issue / verify / revoke from another host
export BANYAN_CA_URL=https://your-ca-host:5180
banyan agent issue --id offsite-agent --cap memory.read --remote $BANYAN_CA_URL
banyan agent verify urn:nps:agent:.../offsite-agent --remote $BANYAN_CA_URL

Use as agent memory

If you're an agent author plugging Banyan into Claude / GPT / your own assistant:

import requests

def recall(query: str, user_id: str, threshold: float = 0.50) -> list[str]:
    r = requests.get("http://banyan-host:5180/api/memory/search",
                     params={"q": query, "mode": "hybrid", "k": 5,
                             "namespace": f"user-{user_id}"}, timeout=2)
    return [h["content"] for h in r.json()["hits"] if h["score"] > threshold]

def remember(fact: str, user_id: str, agent_nid: str | None = None):
    requests.post("http://banyan-host:5180/api/memory", json={
        "content": fact, "namespace": f"user-{user_id}", "agentNid": agent_nid,
    }, timeout=2)

Recall before every turn, write only on explicit signals (the user says "remember X", corrects you, or pins a decision). Full integration guide in docs/recipes/agent-memory.md — covers namespace design, threshold heuristics, write triggers, NID-attested mode, failure recovery, anti-patterns.

Project Structure

src/
├── Banyan.Core         # IMemoryStore, IEmbedder, request/response records
├── Banyan.Lite         # SqliteMemoryStore (BM25 + cosine + RRF + sqlite-vec ANN)
├── Banyan.Embedders    # HashingEmbedder, OnnxEmbedder, EmbedderFactory
├── Banyan.Auth         # NID CA: EmbeddedNipCa, SqliteNipCaStore, RemoteNipCaClient
├── Banyan.Identity     # OLS-backed human identity (OIDC, JWT, RBAC) on SQLite
├── Banyan.Web          # ASP.NET Core web UI + agents/memory/identity REST,
│                         + NPS-3 §8 NIP CA HTTP routes (gap-fill for the NuGet)
├── Banyan.Node         # banyan serve — NPS.NWP MemoryNodeMiddleware host
└── Banyan.Cli          # `banyan` dotnet tool

tests/
├── Banyan.Core.Tests       (5)
├── Banyan.Lite.Tests       (42, incl. 6 ONNX + 5 sqlite-vec)
├── Banyan.Auth.Tests       (46, incl. 7 RemoteNipCaClient + 10 NID middleware)
├── Banyan.Identity.Tests   (43)
└── Banyan.Node.Tests       (8)

Documentation

Document Description
docs/recipes/mcp-server.md Recipe: Claude Desktop / Claude Code MCP integration — banyan mcp quick start, tool reference, system prompt
docs/recipes/agent-memory.md Recipe: connecting an agent (Claude / GPT / custom) to Banyan via HTTP
docs/architecture/editions.md Lite · Pro · Ent tier matrix — NPS compliance + topology, scope of this repo
docs/architecture/storage-tiers.md Memory / identity / CA SQLite schemas, event log, FTS5, vector layout
docs/architecture/nps-mapping.md How Banyan maps to NPS-3 (NCP / NWP / NIP) — what we consume, what we fill in
docs/architecture/identity.md Dual-track identity model: NID for machines, OLS / OIDC for humans
docs/architecture/ols-surface-reference.md Reflected OLS.Root.* API surface (informational)

Built On

License

Apache-2.0. Copyright © 2026 INNO LOTUS PTY LTD.

Product Compatible and additional computed target framework versions.
.NET net10.0 is compatible.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
  • net10.0

    • No dependencies.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated