Skip to content

JSONFIRST/jsonfirst-ai-agents

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 

Repository files navigation

jsonfirst-ai-agents

npm version

AI agents fail when they act on ambiguous input.

JSONFIRST adds a structured intent governance layer before any agent executes — parse, validate, and route natural language deterministically.

Intent → Govern → Execute.

JSONFIRST helps build reliable AI agents by converting natural language into structured JSON intent.

User input (any language, any format)
    ↓
JSONFIRST (parse + govern)
    ↓
JDON: { action, object, confidence, domain }
    ↓
canExecute() → true/false
    ↓
Agent execution (safe)

Quick Example

const { parseIntent, canExecute, getAction } = require('jsonfirst-ai-agents');

const jdon = await parseIntent(
  "cancel the premium subscription for user 42",
  process.env.JSONFIRST_API_KEY
);

if (canExecute(jdon, 0.85)) {
  const action = getAction(jdon); // → "cancel"
  await agents[action].run(jdon);
} else {
  console.log('Low confidence — requesting clarification');
}

Why add a governance layer

Without JSONFIRST:

User: "remove john" → agent deletes user → irreversible

With JSONFIRST:

User: "remove john" → JDON: { action: "delete", confidence: 0.91 }
→ canExecute(jdon, 0.9) → true → agent deletes safely

Installation

npm install jsonfirst-ai-agents

Get your API key at jsonfirst.com → Dashboard → API Console.


API

const { parseIntent, canExecute, getAction } = require('jsonfirst-ai-agents');
Function Description
parseIntent(text, apiKey, opts) Returns structured JDON
canExecute(jdon, threshold) Returns true if confidence ≥ threshold (default: 0.8)
getAction(jdon) Returns normalized action string

Governance Modes

Mode Use case
ANTI_CREDIT_WASTE_V2 Default — fast, token-efficient
MAX_PERFORMANCE Maximum accuracy for critical actions
STRICT_PROTOCOL Enforces full JSONFIRST compliance
GUARDIAN_MODE Enhanced safety for destructive actions

Links


License

MIT © JSONFIRST

Releases

No releases published

Packages

 
 
 

Contributors