@know-graph/core
v0.4.2
Published
Core library for KnowGraph - code knowledge graph
Maintainers
Readme
@know-graph/core
Core library for KnowGraph — parsers, indexer, query engine, and type definitions.
Installation
npm install @know-graph/coreWhat's Included
- Parsers — Language-specific parsers for Python, TypeScript/JavaScript, and a generic comment parser
- Metadata Extractor — Extracts and validates
@knowgraphYAML metadata from code comments - Indexer — SQLite-backed indexer with FTS5 full-text search
- Query Engine — Search and filter indexed entities by text, owner, tags, type, and status
- Types — Zod schemas and TypeScript types for entities, metadata, and manifests
Usage
import {
createDefaultRegistry,
createIndexer,
createQueryEngine,
} from '@know-graph/core';
// Parse files
const registry = createDefaultRegistry();
const results = registry.parse(fileContent, 'src/auth.ts');
// Index a project
const indexer = createIndexer({ dbPath: '.knowgraph/knowgraph.db' });
await indexer.indexDirectory('./src');
// Query the index
const engine = createQueryEngine('.knowgraph/knowgraph.db');
const entities = engine.search('authentication', { owner: 'auth-team' });Documentation
See the main repository for full documentation, annotation format, and examples.
License
MIT
