@epistemicdb/client
v0.2.1
Published
TypeScript client for EpistemicDB — the epistemic database
Downloads
384
Maintainers
Readme
@epistemicdb/client
TypeScript client for EpistemicDB — the epistemic database that models knowledge with decay, confidence, and gaps.
Install
npm install @epistemicdb/clientQuick start
import { createClient } from '@epistemicdb/client'
const edb = createClient('https://your-project.epistemicdb.com', 'edb_sk_...')
// Fetch active knowledge ordered by importance
const result = await edb.query(`
FETCH KO
WHERE decay_score > 0.35
AND confidence > 0.60
AS projection DYNAMIC
ORDER BY K DESC
`)
// Find what you don't know yet
const gaps = await edb.query(`
OPEN GAPS
WHERE urgency > 0.50
ORDER BY urgency DESC
`)
// Predict what will go stale
const stale = await edb.query(`
PROJECT DECAY
WHERE decay_score_at(+30d) < 0.35
RETURN ko, decay_velocity
`)Tagged template literals
const entity = 'pricing'
const threshold = 0.35
const result = await edb.eql`
FETCH KO
WHERE entity = ${entity}
AND decay_score > ${threshold}
ORDER BY K DESC
`Watch for changes
const sub = await edb.watch('WATCH KO WHERE entity = "pricing" AND decay_score < 0.40')
sub.on('update', (event) => {
console.log('KO changed:', event.ko.id, event.changed_fields)
})Documentation
Full docs at epistemicdb.com/docs
