Skip to main content

mcp_knowledge 0.3.0 copy "mcp_knowledge: ^0.3.0" to clipboard
mcp_knowledge: ^0.3.0 copied to clipboard

Unified knowledge management system integrating facts, skills, profiles, and operations with facades, bridges, and event-driven architecture for the MCP ecosystem.

example/example.dart

// The knowledge system over an in-memory fact graph: text ingested through
// the ingest facade, facts read through the fact facade. The example prints
// what it did.
// ignore_for_file: avoid_print

import 'package:mcp_knowledge/mcp_knowledge.dart';

Future<void> main() async {
  final factGraph = FactGraphRuntime.inMemory(defaultWorkspaceId: 'demo');
  await factGraph.initialize();

  final system = KnowledgeSystem(
    config: const KnowledgeConfig(workspaceId: 'demo'),
    ports: KnowledgePorts(facts: factGraph.facts),
    factGraph: factGraph,
  );

  // Evidence and fragments through the ingest pipeline; the fact graph takes
  // them in with the audit chain and the extracted-from edges.
  final ingested = await system.ingest.ingestText(
    'Shipping is included. Returns within 30 days.',
    options: IngestOptions.defaults.copyWith(extractFragments: true),
  );
  print('evidence ${ingested.evidence?.evidenceId}');

  // Facts through the fact facade.
  await system.facts.writeFacts([
    FactRecord(
      id: 'f1',
      workspaceId: 'demo',
      type: 'observation',
      entityId: 'user-1',
      content: const {'value': 42},
      createdAt: DateTime.now(),
    ),
  ]);
  final results = await system.facts.queryFacts(
    const FactQuery(workspaceId: 'demo', entityId: 'user-1'),
  );
  print('${results.length} fact(s) for user-1');

  await system.shutdown();
}
0
likes
150
points
1.21k
downloads

Documentation

API reference

Publisher

verified publishermakemind.dev

Weekly Downloads

Unified knowledge management system integrating facts, skills, profiles, and operations with facades, bridges, and event-driven architecture for the MCP ecosystem.

Homepage
Repository (GitHub)
View/report issues

Topics

#knowledge #mcp #ai #dart #integration

License

MIT (license)

Dependencies

mcp_bundle, mcp_fact_graph, mcp_ingest, mcp_knowledge_ops, mcp_philosophy, mcp_profile, mcp_skill, meta

More

Packages that depend on mcp_knowledge