ruvnet / ruvnet/agentic-flow

agentic-flow/core and /coordination are shipped but not in the exports map; and enableGNN:true is silently dropped, then gnnEnhancedSearch blames the caller for not setting it

Open
#189 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
TypeScript
Stars
812
Forks
175
Avg merge
2m
Merged PRs (30d)
3

Description

Summary

Two problems in one documented example:

  1. agentic-flow/core and agentic-flow/coordination are not exported, so the documented imports fail at resolution — even though the code for both is shipped in the tarball.
  2. Once loaded by absolute path, enableGNN: true is silently ignored and gnnEnhancedSearch() then rejects with "GNN not enabled. Set enableGNN: true in config" — the flag you already set. The underlying cause is that @ruvector/gnn is not a declared dependency and the resolved copy exports no GraphNeuralNetwork.

Version: agentic-flow 2.1.2, Node v22.23.0, macOS 15 (darwin 25.6.0).

1. The documented subpaths are not exported

import { EnhancedAgentDBWrapper } from 'agentic-flow/core';
import { AttentionCoordinator } from 'agentic-flow/coordination';
Error [ERR_PACKAGE_PATH_NOT_EXPORTED]: Package subpath './core' is not defined
by "exports" in .../node_modules/agentic-flow/package.json

Same for ./coordination. The exports map declares 17 subpaths — ., ./agent-booster, ./embeddings, ./harness/governance, ./harness/metaharness, ./harness/provenance, ./orchestration, ./package.json, ./reasoningbank, ./reasoningbank/backend-selector, ./reasoningbank/wasm-adapter, ./repair, ./router, ./router/cost-optimal, ./sdk, ./transport/loader, ./transport/quic — and neither ./core nor ./coordination is among them.

The code is present in the published package, it is just walled off:

dist/core/agentdb-wrapper-enhanced.js          → class EnhancedAgentDBWrapper, gnnEnhancedSearch
dist/coordination/attention-coordinator.js     → class AttentionCoordinator, createAttentionCoordinator

So this is a packaging omission rather than a missing feature. Adding "./core" and "./coordination" to exports would make the documented example importable.

2. enableGNN: true is ignored, and the error blames the caller

Loading the shipped files directly by absolute path (bypassing exports) to get past problem 1:

const base = '.../node_modules/agentic-flow/dist/';
const { EnhancedAgentDBWrapper } = await import(base + 'core/agentdb-wrapper-enhanced.js');

const w = new EnhancedAgentDBWrapper({
  enableAttention: true,
  enableGNN: true,
  attentionConfig: { type: 'flash' },
});

await w.initialize();                                   // resolves
await w.gnnEnhancedSearch('how do I reset my password', { k: 5 });

Output:

🚀 Initializing Enhanced AgentDB with advanced features...
❌ Auto-initialization failed: Error: Failed to initialize Enhanced AgentDB:
   AgentDB not initialized. Call initialize() first.
[AgentDB] Using RuVector backend (native)
✅ Loaded @ruvector/attention NAPI module
✅ AttentionService initialized in 7.28ms (nodejs)
  ⚠️  GNN Service initialization failed: Error: GraphNeuralNetwork not found in @ruvector/gnn
  ⚠️  Continuing without GNN features
>>> initialize() RESOLVED
>>> gnnEnhancedSearch THREW: GNN not enabled. Set enableGNN: true in config.

Three separate things wrong here:

  • The constructor's auto-init fails telling you to do what it is doing. ❌ Auto-initialization failed: … Call initialize() first. is emitted from the constructor's own auto-initialization path. An explicit await initialize() afterwards does succeed, so the message is misleading noise on the happy path.
  • enableGNN: true degrades to false with only a warning. The wrapper logs Continuing without GNN features and carries on, so a caller that isn't reading stderr believes GNN is on.
  • The eventual error blames the caller for the library's own fallback: GNN not enabled. Set enableGNN: true in config — when enableGNN: true is exactly what was passed. It should say the GNN service failed to initialize, and ideally name the missing symbol.

enableAttention works: @ruvector/attention loads and AttentionService initialized in 7.28ms. Only the GNN half is broken.

Root cause of the GNN failure

@ruvector/gnn is not declared as a dependency of agentic-flow at all:

// node_modules/agentic-flow/package.json — 2.1.2
// dependencies + optionalDependencies + peerDependencies, filtered:
{
  '@ruvector/core': '^0.1.29', '@ruvector/edge-full': '^0.1.0',
  '@ruvector/router': '^0.1.30', '@ruvector/ruvllm': '^2.5.5',
  '@ruvector/tiny-dancer': '^0.1.17', 'ruvector': '0.2.40',
  'ruvector-onnx-embeddings-wasm': '^0.1.2',
  '@ruvector/attention': '^0.1.4', '@ruvector/sona': '^0.1.4'
}
// '@ruvector/gnn' declared: false

The copy that happens to resolve (0.1.25, present transitively) exports:

RuvectorLayer, TensorCompress, differentiableSearch,
getCompressionLevel, hierarchicalForward, init

No GraphNeuralNetwork. So the import can never succeed at any version currently reachable — and since the package isn't declared, whether it resolves at all depends on hoisting.

Impact

The documented customer-support example is the flagship use of gnnEnhancedSearch, advertised as "+12.4% better recall". As shipped, that path cannot execute:

  • the import fails outright, and
  • if worked around, GNN is off no matter what the config says.

Suggested fix

  1. Add "./core" and "./coordination" to the exports map (the files already ship).
  2. Declare @ruvector/gnn as a dependency at a version that actually exports GraphNeuralNetwork — or update the wrapper to the symbol the current package provides (RuvectorLayer / hierarchicalForward look like the intended surface).
  3. When enableGNN: true and the GNN service fails, either throw at initialize() or keep a flag distinguishing "not requested" from "requested but unavailable", so the later error can say the truth instead of Set enableGNN: true in config.
  4. Silence or fix the constructor's ❌ Auto-initialization failed … Call initialize() first message, which fires on a run that ultimately succeeds.

Related

  • #188 — the README's root-level AgenticFlow import doesn't exist either.
  • #182, #185, #186, #187 — commands that exit 0 while reporting something other than what happened. Item 2 above is the library-side version: a config flag accepted, silently dropped, then blamed on the caller.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with package.json and the shipped dist/core/agentdb-wrapper-enhanced.js and dist/coordination/attention-coordinator.js files; reproduce the documented imports and the enableGNN initialization path. Trace the GNN dependency and initialization logs, then verify that the documented subpaths resolve and that failed GNN setup reports the service failure rather than blaming the caller.

Written by the indexing model from the issue text.

Assessment

Tech stack
node.js, typescript
Domain
backend, build-system
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
48/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.