Skip to content

Comments

Feat/knowledge module#224

Merged
dev-ainetwork merged 10 commits intomasterfrom
feat/knowledge-module
Feb 18, 2026
Merged

Feat/knowledge module#224
dev-ainetwork merged 10 commits intomasterfrom
feat/knowledge-module

Conversation

@kmh4500
Copy link
Collaborator

@kmh4500 kmh4500 commented Feb 18, 2026

No description provided.

nvidia and others added 9 commits February 16, 2026 20:51
…lementations, and benchmarks

Introduces a pluggable graph backend interface (GraphBackend) with two implementations:
- MemoryBackend: zero-dependency in-memory graph for testing and lightweight use
- Neo4jBackend: Cypher-based implementation for production graph queries

Includes KnowledgeGraph high-level API, blockchain knowledge interface, benchmark suite
comparing blockchain vs in-memory vs Neo4j (17-paper transformer graph), unit tests
(26 passing), and example scripts.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Attaches native function triggers (_syncKnowledgeTopic,
_syncKnowledgeExploration) during app setup so the blockchain node's
graph index stays in sync with on-chain topic and exploration writes.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
…ration tests state-resilient

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
…ructure

- Add publishCourse() convenience method: uploads content to gateway, records gated metadata on-chain
- Add AinTransferSchemeClient for x402 payments using AIN token transfers on local testnet
- Add setupAinX402Client() for easy x402 configuration
- Rewrite access() to handle 402->pay->retry flow directly (replaces @x402/fetch dependency)
- Add knowledge graph: explore() now writes graph nodes and optional edges (extends/related/prerequisite)
- Add parentEntry/relatedEntries to ExploreInput for linking entries in the graph
- Add getGraph(), getGraphNode(), getNodeEdges(), buildNodeId() query methods
- Add graph write rules to setupApp()
- New types: GraphNode, GraphEdge, EntryRef, PublishCourseInput, PublishCourseResult

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
secp256k1@3.x uses nan which relies on V8 APIs (AccessorSignature,
GetContents) removed in Node 20, causing native addon compilation to
fail and eccrypto to fall back to its slow browser implementation.

- Add npm overrides to force secp256k1@^4.0.3 (uses N-API prebuilds)
- Add patch-package patch for @ainblockchain/ain-util: wraps v4 API
  (ecdsaSign/ecdsaVerify/ecdsaRecover) with Buffer return types
- Add patch-package patch for eccrypto: same v4 API wrapper plus
  replaces native ecdh addon with secp256k1.ecdh()

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Each explore()/registerTopic() call was making 7+ separate bolt sessions,
each with ~4-5ms overhead. This groups all operations from a single
high-level call into one session/transaction via withTransaction().

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
…ckchain

- Dockerfile: node:18 → node:20 (ain-blockchain requires >=20)
- test-pipeline.sh: checkout feat/knowledge-module branch which has
  secp256k1 v4 overrides and patches needed for Node 20

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@dev-ainetwork dev-ainetwork merged commit 88c53f1 into master Feb 18, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants