8000 GitHub - lsfgrd/decision-engine
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

lsfgrd/decision-engine

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Decision Engine

This repository contains a simple decision engine system that allows non-technical users to design algorithmic decision policies through a visual interface and put them into production without programming knowledge.

System Overview

The decision engine consists of four main components:

  1. ConfigFrontend: A React-based web application that provides a visual block-based interface for policy creation
  2. ConfigBackend: A FastAPI service that stores and manages policy configurations
  3. PolicyDB: A storage system for persisting policy data (implemented as file-based storage for simplicity)
  4. ExecutionEngine: A REST API that evaluates input data against the stored policy and returns decisions

Flow of Information

  1. A policy creator designs a decision policy using the ConfigFrontend's visual editor
  2. The policy is saved via the ConfigBackend and stored in the PolicyDB
  3. Customer systems can then send data to the ExecutionEngine
  4. The ExecutionEngine evaluates the data against the stored policy and returns the decision result

Policy Representation

Policies are represented as directed graphs in the frontend and as nested tree structures in the backend:

  • Each node represents a decision point or outcome
  • Conditional nodes have "yes" and "no" branches
  • End nodes contain the final decision value
  • The structure supports arbitrary nested conditions

Getting Started

Follow these steps to run the entire decision engine system.

Prerequisites

  • Node.js v18.18+ (for frontend)
  • pnpm v9.12+ (for frontend)
  • Python 3.9+ (for backend)
  • Git

Installation

  1. Clone the repository

  2. Install and run the backend (in one terminal):

    cd backend
    pip install -r requirements.txt
    uvicorn app.main:app --reload

    The backend will run at http://localhost:8000

  3. Install and run the frontend (in another terminal):

    cd frontend
    pnpm install
    pnpm run dev

    The frontend will run at http://localhost:5173

Detailed Instructions and Documentation

For more detailed instructions and documentation:

Usage Guide

Creating a Decision Policy

  1. Open the frontend application in your browser
  2. Use the interface to design your policy:
    • Add Conditional blocks to check input variables
    • Edit the End blocks to specify decision values
  3. Save your policy by clicking the "Save Policy" button

Testing the Decision Engine

Once a policy is created, you can test it using:

curl -X 'POST' \
  'http://localhost:8000/execution/execute' \
  -H 'Content-Type: application/json' \
  -d '{
  "age": 20,
  "income": 2000
}'

For more example requests, refer to the backend/README.md.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published
0