Skip to content

markiatheus/aslan-engine

Repository files navigation

Aslan Engine

This is the documentation for Aslan Engine, an Modus API for the Aslan Health AI Agent.

Aslan can create verifiable credentials for patients, verify credentials and generate health summaries, suggestions, and predictive insights in a agentic way that is secure for patients. The agent is connected to a dGraph database to store patient data and verifiable credentials, and use the Llama Health Insights model to analyze patient data as a GraphRAG system.

Circom Compilation and Snark.js Computation

In ./circuits, run circom health_credential.circom --wasm --json.

Use snark.js in Modus to compute a witness and generate a proof before validating the proof using the DID's Verifiable Credential for health data like high blood pressure, low blood sugar, etc.

Importing NPM Packages to AssemblyScript

Since AssemblyScript does not directly support all JavaScript features or types, we need to create type declaration files for the npm packages we want to use. These are located in assembly/lib/:

  1. Package Declaration Files:

    • did-jwt-vc.ts: Types for Verifiable Credentials
    • did-resolver.ts: Types for DID resolution
    • snarkjs.ts: Types for ZK-SNARK operations
    • fs.ts and path.ts: Node.js file system types
  2. Configuration: The asconfig.json includes these declarations:

    {
      "options": {
        "lib": ["assembly/lib"]
      }
    }
  3. Dependencies: Required packages are listed in package.json:

    {
      "dependencies": {
        "did-jwt-vc": "^4.0.4",
        "did-resolver": "^4.1.0",
        "snarkjs": "^0.7.5"
      }
    }
  4. Usage:

    import { createVerifiableCredentialJwt } from 'did-jwt-vc'
    import { Resolver } from 'did-resolver'
    import { groth16 } from 'snarkjs'

These declarations should now allow the imports in index.ts to work properly. The declarations are compatible with AssemblyScript and provide type information for the Node.js built-in modules we're using.

Use Modus to Generate an API

# Run Modus Locally as a Development Environment
modus dev
# Build AssemblyScript for Modus
pnpm run build

References

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published