AI Decision System
Replayable, offline-verifiable records for AI-assisted go/no-go decisions: experiment promotions, typed model answers and human-approved actions.
CortexJS: 사용하기 쉬운 수학 입력, 웹 전용 MathJSON, 기호·수치 계산 엔진으로 과학 컴퓨팅을 향상
CortexJS: Enhancing scientific computing with user-friendly mathfield for easy math input, MathJSON for a web-native math format, and a versatile Compute Engine for symbolic and numerical computation.
개발 도구TypeScript · JavaScriptGitHub @cortex-js온라인운영자 미확인
써 보셨어요? 한 번만 눌러 주세요. 로그인은 필요 없어요.
아직 감지된 업데이트가 없습니다. GitHub 릴리스가 나오면 여기에 보입니다.
개인 계정의 공개 저장소 소유자는 GitHub로 로그인해 운영자를 확인하고 소개를 직접 관리할 수 있습니다. 관리자 승인은 필요하지 않습니다.
로그인한 뒤 확인 파일을 만들어 이 저장소의 기본 브랜치에 30분 안에 커밋해 주세요. 다른 브랜치나 포크의 파일은 인정하지 않습니다. 파일을 올린 뒤 아래에서 확인하면 관리자 승인 없이 관리할 수 있습니다. 자격을 유지하려면 파일을 남겨 두세요.
로그인이 필요하면 로그인 화면으로 이동합니다. 로그인 후 이곳으로 돌아와 원하는 확인 버튼을 다시 눌러 주세요.
프로젝트 폴더에서 /nomorevibe verify를 실행하면 소유권을 확인하고 소개를 직접 관리할 수 있습니다.
1분 만에 확인하기An engine for symbolic manipulation and numeric evaluation of math formulas expressed with MathJSON
저장소 README에서 가져옴
README 전체를 불러오는 중입니다.
README 전문 보기 ↗MathJSON is a lightweight mathematical notation interchange format based on JSON.
The Compute Engine can parse LaTeX to MathJSON, serialize MathJSON to LaTeX or MathASCII, format, simplify and evaluate MathJSON expressions.
Reference documentation and guides at cortexjs.io/compute-engine.
$ npm install --save @cortex-js/compute-engine
No setup required:
import { simplify, evaluate, N, assign } from "@cortex-js/compute-engine";
simplify("x + x + 1").print();
// ➔ 2x + 1
evaluate("2^{11} - 1").print();
// ➔ 2047
N("\\sqrt{2}").print();
// ➔ 1.414213562...
assign("x", 3);
evaluate("x + 2").print();
// ➔ 5
These functions use a shared ComputeEngine instance created on first use. Use
getDefaultEngine() to configure it, or create your own instance for isolated
configurations.
Use type guards to safely access specialized properties:
import { evaluate, isNumber } from "@cortex-js/compute-engine";
const expr = evaluate("\\frac{5}{2}");
if (isNumber(expr)) {
console.log(expr.numericValue); // 2.5 (type-safe access)
console.log(expr.isInteger); // false
}
import { parse, isSymbol, sym } from "@cortex-js/compute-engine";
const expr = parse("x + 1");
// Check if expression is a specific symbol
if (sym(expr) === "x") {
console.log("This is the variable x");
}
// Or use full type guard for more access
const variable = parse("y");
if (isSymbol(variable)) {
console.log(variable.symbol); // "y"
}
import { parse, isFunction } from "@cortex-js/compute-engine";
const expr = parse("2x + 3y");
// Access function structure safely
if (isFunction(expr)) {
console.log(expr.operator); // "Add"
console.log(expr.ops.length); // 2
// Iterate over operands
for (const op of expr.ops) {
console.log(op.toString());
}
}
import { parse, simplify, expand } from "@cortex-js/compute-engine";
// Simplify expressions
simplify("x + x").print();
// ➔ 2x
// Expand from LaTeX or Expression
expand("(x + 1)^2").print();
// ➔ x^2 + 2x + 1
// Substitute values
const expr = parse("x^2 + 2x + 1");
expr.subs({ x: 3 }).evaluate().print();
// ➔ 16
import { solve, parse } from "@cortex-js/compute-engine";
// Solve from LaTeX
solve("x^2 - 5x + 6 = 0", "x");
// ➔ [2, 3]
// Solve a linear system
const system = parse("\\begin{cases}x+y=5\\\\x-y=1\\end{cases}");
const solution = system.solve(["x", "y"]);
console.log(solution.x.json); // 3
console.log(solution.y.json); // 2
Epsil is a text-syntax programming language for scientific computing whose intermediate representation is MathJSON, evaluated by the Compute Engine. It ships as a separate, experimental entry point (syntax and semantics may change between releases):
import { ComputeEngine, executeEpsil } from "@cortex-js/compute-engine/epsil";
const ce = new ComputeEngine();
const { value } = executeEpsil(ce, `
let x = 1/2
if (x < 1) { x + 1 } else { 0 }
`);
// value.toString() ➔ "3/2"
See the Epsil language documentation.
The package also installs an epsil command:
# Start an interactive session
npx epsil
# Evaluate source text or a file
npx epsil -e 'Simplify(2 + 2x)'
npx epsil program.epsil
# Epsil programs can also be piped over stdin
printf '1/2 + 1' | npx epsil
The interactive session preserves declarations between inputs and supports
persistent history, multiline input, .load, .clear, .ast, and .time. Run
epsil --help for output formats and execution-limit options.
The epsil command includes a
Model Context Protocol server, so an AI
assistant can evaluate Epsil programs — exact arithmetic and symbolic
computation as a tool call. For example, with Claude Code:
claude mcp add epsil -- npx -y @cortex-js/compute-engine mcp
The server exposes evaluate, check, doc, parse, and serialize tools,
and serves machine-verified cards so the assistant can learn Epsil, and the
Compute Engine JavaScript API, on its own. It also has a native Streamable HTTP transport for ChatGPT and other
URL-based clients:
npx -y @cortex-js/compute-engine mcp --transport streamable-http
See the MCP server guide for ChatGPT setup and HTTPS deployment options.
💡 Best Practices:
isNumber, isSymbol, isFunction) before accessing
specialized propertiessym() helper for quick symbol name checks📚 Learn More: Full documentation and guides
Q How do I build the project?
Build instructions
Q How is the project structured?
See ARCHITECTURE.md for an overview of the codebase.
This project is licensed under the MIT License.