New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

graphmind

Package Overview
Dependencies
Maintainers
1
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

graphmind

Knowledge graphs as a long-term memory for your AI assistants

latest
Source
npmnpm
Version
0.2.1
Version published
Maintainers
1
Created
Source

[!NOTE] Disclosure: This project is developed using LLM-assisted engineering with nWave.

graphmind

Knowledge graphs as a long-term memory for your AI assistants

Installation

From npm

Add the plugin and built-in skills to your OpenCode configuration:

{
  "$schema": "https://opencode.ai/config.json",
  "plugin": ["graphmind"],
  "skills": {
    "paths": ["~/.cache/opencode/node_modules/graphmind/skill"]
  }
}

OpenCode will automatically install the plugin on startup. See the Skills section for available skills and alternative path configurations.

Features

Wikidata Query Tool

Query Wikidata for factual information about the world using the wikidata_query tool. This tool is optimized for querying the Wikidata knowledge base, which contains structured data about people, places, events, concepts, and more.

Key Features:

  • Automatic Wikidata prefix injection (wd:, wdt:, p:, ps:, pq:, etc.)
  • Optimized default timeout for Wikidata queries (30 seconds)
  • Helpful error messages with guidance for common issues
  • Support for Wikidata-specific features like the label service

Use Cases:

  • Historical facts and events
  • Geographical data and locations
  • Information about people and organizations
  • Scientific concepts and classifications
  • Cultural and general world knowledge

SPARQL Query Tool

Execute SPARQL queries over RDF data sources using the sparql_query tool. This tool uses Comunica under the hood to provide flexible querying capabilities.

Supported Query Types:

  • SELECT - Retrieve bindings for variables
  • CONSTRUCT - Generate RDF triples
  • DESCRIBE - Retrieve RDF descriptions
  • ASK - Boolean queries

Supported Data Sources:

  • SPARQL endpoints (e.g., DBpedia, Wikidata)
  • Triple Pattern Fragments (TPF) servers
  • RDF files (Turtle, N-Triples, JSON-LD, etc.)
  • Solid pods
  • Any URL serving RDF data

Usage Examples

Wikidata Queries

Find Information About a Person

Who is Douglas Adams and when was he born?

OpenCode will construct a Wikidata query like:

{
  "query": "SELECT ?personLabel ?birthDate WHERE { wd:Q42 wdt:P569 ?birthDate. SERVICE wikibase:label { bd:serviceParam wikibase:language 'en'. } }"
}

Find Countries by Population

What are the 10 most populous countries in the world?

Historical Events

What major events happened in 1969?

The tool automatically adds all necessary Wikidata prefixes, so you can focus on writing the query logic.

Basic SELECT Query

Query DBpedia for the first 10 triples:

Can you query DBpedia for the first 10 triples?

OpenCode will use the tool with parameters like:

{
  "query": "SELECT * WHERE { ?s ?p ?o } LIMIT 10",
  "sources": ["https://fragments.dbpedia.org/2016-04/en"]
}

Query Multiple Sources

Query across multiple RDF sources simultaneously:

Query DBpedia and Wikidata for entities related to "artificial intelligence"

CONSTRUCT Query

Generate RDF triples:

Use a CONSTRUCT query to get book information from DBpedia

Custom Output Format

Request specific output formats:

{
  "query": "SELECT * WHERE { ?s ?p ?o } LIMIT 10",
  "sources": ["https://fragments.dbpedia.org/2016-04/en"],
  "outputFormat": "text/csv"
}

Available Output Formats:

  • application/json (default for SELECT)
  • application/sparql-results+json
  • application/sparql-results+xml
  • text/csv
  • text/tab-separated-values
  • text/turtle (default for CONSTRUCT)
  • application/trig
  • application/n-triples
  • application/n-quads
  • application/ld+json

Advanced Options

{
  "query": "SELECT * WHERE { ?s ?p ?o } LIMIT 10",
  "sources": ["https://fragments.dbpedia.org/2016-04/en"],
  "baseIRI": "http://example.org/",
  "lenient": true,
  "httpTimeout": 30000,
  "logLevel": "debug"
}

Tool Parameters

wikidata_query

ParameterTypeRequiredDescription
querystringYesSPARQL query for Wikidata (prefixes added automatically)
outputFormatstringNoOutput format: json, csv, tsv, xml (default: json)
httpTimeoutnumberNoHTTP timeout in milliseconds (default: 30000)
logLevelstringNoLog level: error, warn, info, or debug

Note: The tool automatically adds common Wikidata prefixes (wd:, wdt:, p:, ps:, pq:, wikibase:, bd:, rdfs:) if they're not already in your query.

sparql_query

ParameterTypeRequiredDescription
querystringYesThe SPARQL query string to execute
sourcesstring[]YesOne or more URLs to query over
outputFormatstringNoOutput format for results
baseIRIstringNoBase IRI for the query
lenientbooleanNoIf true, log errors instead of throwing
httpTimeoutnumberNoHTTP request timeout in milliseconds
logLevelstringNoLog level: error, warn, info, or debug

Skills

Graphmind ships domain-specific skills that give your AI agent knowledge about SPARQL query patterns and RDF modeling conventions. Skills are instruction files that improve how agents use the plugin's tools.

Available Skills

SkillDescription
graphmind-wikidataAnswer real-world factual questions by querying Wikidata, the world's largest open knowledge base
graphmind-sparql-patternsCommon SPARQL query patterns for querying RDF knowledge graphs with Graphmind
graphmind-rdf-modelingRDF modeling patterns and ontology conventions for knowledge graph construction

Enabling Skills

Add the skills path to your opencode.json:

{
  "$schema": "https://opencode.ai/config.json",
  "plugin": ["graphmind"],
  "skills": {
    "paths": ["node_modules/graphmind/skills"]
  }
}

If OpenCode installed the plugin to its cache directory, use the cache path instead:

{
  "skills": {
    "paths": ["~/.cache/opencode/node_modules/graphmind/skills"]
  }
}

For local plugin installations, point to the local path:

{
  "skills": {
    "paths": [".opencode/plugins/graphmind/skills"]
  }
}

Requirements

  • Node.js >= 18.0.0
  • The plugin automatically installs Comunica dependencies

License

MIT

Keywords

opencode

FAQs

Package last updated on 20 Mar 2026

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts