factcircuit
FactCircuit는 불변 출처와 단계별 검증, 제한된 검색, 재현 가능한 평가를 제공하는 감사 가능한 주장·증거 검증 루프입니다
TypeGraph TypeScript용 내장 지식 그래프
Embedded knowledge graph for TypeScript. Define your ontology with Zod, query with a fluent builder, blend BM25 fulltext with vector similarity, and extend the schema at runtime when your agents need
데이터TypeScript · JavaScriptGitHub @nicia-ai온라인운영자 미확인
써 보셨어요? 한 번만 눌러 주세요. 로그인은 필요 없어요.
The Knowledge Graph for TypeScript
저장소 README에서 가져옴
README 전체를 불러오는 중입니다. 아래는 저장된 발췌입니다.
TypeScript-first embedded knowledge graph library.
TypeGraph brings property graph modeling and practical ontology support to your existing SQLite or PostgreSQL
database. Define nodes and edges with Zod, query with a fluent TypeScript API, and keep graph + app data in one
deployment.README 전문 보기 ↗TypeScript-first embedded knowledge graph library.
TypeGraph brings property graph modeling and practical ontology support to your existing SQLite or PostgreSQL database. Define nodes and edges with Zod, query with a fluent TypeScript API, and keep graph + app data in one deployment.
subClassOf, implies, inverseOf, and disjointWithTypeGraph works well for:
TypeGraph is not designed for:
npm install @nicia-ai/typegraph zod drizzle-orm better-sqlite3
npm install -D @types/better-sqlite3
For edge/serverless environments (Cloudflare Durable Objects, D1, libsql, bun:sqlite), see the docs: Edge and Serverless.
import { z } from "zod";
import { defineEdge, defineGraph, defineNode } from "@nicia-ai/typegraph";
import { createLocalSqliteStore } from "@nicia-ai/typegraph/sqlite/local";
const Person = defineNode("Person", {
schema: z.object({ name: z.string(), role: z.string().optional() }),
});
const Project = defineNode("Project", {
schema: z.object({ name: z.string(), status: z.enum(["active", "done"]) }),
});
const worksOn = defineEdge("worksOn");
const graph = defineGraph({
id: "my_app",
nodes: {
Person: { type: Person },
Project: { type: Project },
},
edges: {
worksOn: { type: worksOn, from: [Person], to: [Project] },
},
});
const store = await createLocalSqliteStore(graph);
const alice = await store.nodes.Person.create({ name: "Alice", role: "Engineer" });
const website = await store.nodes.Project.create({ name: "Website", status: "active" });
await store.edges.worksOn.create(alice, website, {});
const results = await store
.query()
.from("Person", "p")
.traverse("worksOn", "e")
.to("Project", "proj")
.select((ctx) => ({ person: ctx.p.name, project: ctx.proj.name }))
.execute();
console.log(results);
// [{ person: "Alice", project: "Website" }]
For production schema management, see: createStoreWithSchema.
The managed SQLite entrypoint provisions the schema and returns the complete,
schema-derived Store API without exposing Drizzle types. PostgreSQL consumers
can use the equivalent createLocalPgliteStore from
@nicia-ai/typegraph/postgres/pglite. Bring-your-own-connection integrations
live under the explicit /adapters/drizzle/... entrypoints.
Packages that only define or share graph schemas can import the DSL and its
schema-derived types from @nicia-ai/typegraph/core. Custom backend and search
strategy authors can use the complete Drizzle-free contract vocabulary from
@nicia-ai/typegraph/backend.
drizzle-orm is an optional peer dependency. @nicia-ai/typegraph/sqlite/local
and @nicia-ai/typegraph/postgres/pglite load it only when their factory is
called and refuse with a typed ConfigurationError
(MISSING_PEER_DEPENDENCY) naming the package and the install command
(npm install drizzle-orm) when it is absent. The six explicit
/adapters/drizzle/... entrypoints expose Drizzle-native backends, connections,
or schema builders and load drizzle-orm when the module is evaluated. Importing
one without the peer installed therefore surfaces the raw module-resolution
error, which names the same package.
TypeGraph publishes agent-friendly documentation following the llms.txt convention:
Recommended retrieval order: llms-small → llms-full → examples.
MIT