Rajan Punchouty
    • Create new note
    • Create a note from template
      • Sharing URL Link copied
      • /edit
      • View mode
        • Edit mode
        • View mode
        • Book mode
        • Slide mode
        Edit mode View mode Book mode Slide mode
      • Customize slides
      • Note Permission
      • Read
        • Only me
        • Signed-in users
        • Everyone
        Only me Signed-in users Everyone
      • Write
        • Only me
        • Signed-in users
        • Everyone
        Only me Signed-in users Everyone
      • Engagement control Commenting, Suggest edit, Emoji Reply
    • Invite by email
      Invitee

      This note has no invitees

    • Publish Note

      Share your work with the world Congratulations! 🎉 Your note is out in the world Publish Note

      Your note will be visible on your profile and discoverable by anyone.
      Your note is now live.
      This note is visible on your profile and discoverable online.
      Everyone on the web can find and read all notes of this public team.
      See published notes
      Unpublish note
      Please check the box to agree to the Community Guidelines.
      View profile
    • Commenting
      Permission
      Disabled Forbidden Owners Signed-in users Everyone
    • Enable
    • Permission
      • Forbidden
      • Owners
      • Signed-in users
      • Everyone
    • Suggest edit
      Permission
      Disabled Forbidden Owners Signed-in users Everyone
    • Enable
    • Permission
      • Forbidden
      • Owners
      • Signed-in users
    • Emoji Reply
    • Enable
    • Versions and GitHub Sync
    • Note settings
    • Note Insights New
    • Engagement control
    • Make a copy
    • Transfer ownership
    • Delete this note
    • Save as template
    • Insert from template
    • Import from
      • Dropbox
      • Google Drive
      • Gist
      • Clipboard
    • Export to
      • Dropbox
      • Google Drive
      • Gist
    • Download
      • Markdown
      • HTML
      • Raw HTML
Menu Note settings Note Insights Versions and GitHub Sync Sharing URL Create Help
Create Create new note Create a note from template
Menu
Options
Engagement control Make a copy Transfer ownership Delete this note
Import from
Dropbox Google Drive Gist Clipboard
Export to
Dropbox Google Drive Gist
Download
Markdown HTML Raw HTML
Back
Sharing URL Link copied
/edit
View mode
  • Edit mode
  • View mode
  • Book mode
  • Slide mode
Edit mode View mode Book mode Slide mode
Customize slides
Note Permission
Read
Only me
  • Only me
  • Signed-in users
  • Everyone
Only me Signed-in users Everyone
Write
Only me
  • Only me
  • Signed-in users
  • Everyone
Only me Signed-in users Everyone
Engagement control Commenting, Suggest edit, Emoji Reply
  • Invite by email
    Invitee

    This note has no invitees

  • Publish Note

    Share your work with the world Congratulations! 🎉 Your note is out in the world Publish Note

    Your note will be visible on your profile and discoverable by anyone.
    Your note is now live.
    This note is visible on your profile and discoverable online.
    Everyone on the web can find and read all notes of this public team.
    See published notes
    Unpublish note
    Please check the box to agree to the Community Guidelines.
    View profile
    Engagement control
    Commenting
    Permission
    Disabled Forbidden Owners Signed-in users Everyone
    Enable
    Permission
    • Forbidden
    • Owners
    • Signed-in users
    • Everyone
    Suggest edit
    Permission
    Disabled Forbidden Owners Signed-in users Everyone
    Enable
    Permission
    • Forbidden
    • Owners
    • Signed-in users
    Emoji Reply
    Enable
    Import from Dropbox Google Drive Gist Clipboard
       Owned this note    Owned this note      
    Published Linked with GitHub
    • Any changes
      Be notified of any changes
    • Mention me
      Be notified of mention me
    • Unsubscribe
    --- title: 'Brain OS Onbaording' disqus: hackmd --- Brain OS Onboarding === ## Table of Contents [TOC] ## Business Onboardin Steps ### 1. Knowledge Onboarding 1. Define entity schema 2. Source one or multiple excel/csv for data 3. Configure excel/csv columns mapping 4. Upload file using Brain UI workbench ### 2. Trasaction Onboarding 1. Configure Azure bucket or kafka topics for ingestion process 2. Define column or field mapping 3. Define ingestion event schema ### 3. Feature definition and DAG 1. Define target feature that needed to be generated 2. Using brain os building blocks create a pseudocode defining data transformation from ingestion to target features in form of DAG 3. Define input and output event schema for each processes in DAG 4. Define configuration of each process in brain ui workbench ### 4. Function definition 1. Identify machine learning, deep learning, rules and optimization functions for a domain 2. Configure these function using brain ui workbench with its input and output features Knowledge Onboarding --- #### Step 1 : Identify all entities for a domain. #### Step 2 : Define all **quantities** (schemas) and **units** needed to create above entities :::info Current focus is on **Atomic, Spatial and Temporal** Quantity ::: ```protobuf= message BrainQuantitySchema { jio.brain.proto.base.BrainToken token = 1; jio.brain.proto.base.BrainQuantityType quantity_type = 3; oneof quantity_schema_is_one_of { BrainAtomicQuantitySchema atomic = 4; BrainCompoundQuantitySchema compound = 5; BrainTemporalQuantitySchema temporal = 6; BrainSpatialQuantitySchema spatial = 7; BrainMediaQuantitySchema media = 8; } } message BrainAtomicQuantitySchema { BrainAtomicQuantityType atomic_type = 1; oneof quantity_schema_is_one_of { BrainNumericQuantitySchema numeric_schema = 2; BrainSymbolicQuantitySchema symbolic_schema = 3; BrainOrdinalQuantitySchema ordinal_schema = 4; BrainBinnedQuantitySchema binned_schema = 5; BrainBinaryQuantitySchema binary_schema = 6; } } message BrainTemporalQuantitySchema { oneof temporal_is_one_of { BrainTemporalInstanceQuantitySchema instance = 1; BrainTemporalRangeQuantitySchema range = 2; BrainTemporalDurationQuantitySchema duration = 3; BrainTemporalContextQuantitySchema context = 4; } } message BrainSpatialQuantitySchema { oneof location_schema_is_one_of { bool lat_long = 1; BrainSpatialGeohashQuantitySchema geohash = 2; BrainSpatialHierarchyLevel location_hierarchy_level = 3; } } ``` #### Step 3 : Define entity schema for all entities. It include biz id's, name, attributes and predicates ```protobuf= message BrainEntitySchema { jio.brain.proto.base.BrainToken token = 1; jio.brain.proto.base.BrainToken primary_biz_id = 2; repeated jio.brain.proto.base.BrainToken biz_type = 4; BrainAttributeSetSchema attribute = 5; BrainPredicateSetSchema predicate = 6; repeated BrainAttributeFamilySchema attribute_family_set = 7; } message BrainAttributeSetSchema { map<string, BrainAttributeSchema> attribute = 5; } message BrainPredicateSetSchema { map<string, BrainPredicateSchema> predicate = 5; } message BrainAttributeSchema { jio.brain.proto.base.BrainToken attribute_token = 1; optional jio.brain.proto.base.BrainToken unit_token = 2; oneof attribute_is_one_of { jio.brain.proto.quantity.BrainQuantitySchema absolute = 3; BrainQualifiedAttributeSchema qualifiers = 4; } bool is_knowledge_attribute = 5; } message BrainQualifiedAttributeSchema { jio.brain.proto.quantity.BrainQuantitySchema value = 1; map<string, BrainAttributeQualifierSchema> qualifiers = 2; } message BrainAttributeQualifierSchema { jio.brain.proto.base.BrainToken token = 1; jio.brain.proto.quantity.BrainQuantitySchema quantity = 2; optional jio.brain.proto.base.BrainToken unit = 3; } message BrainPredicateSchema { jio.brain.proto.base.BrainToken predicate = 1; jio.brain.proto.base.BrainToken object = 2; map<string, BrainPredicateQualifierSchema> qualifiers = 3; } message BrainPredicateQualifierSchema { jio.brain.proto.base.BrainToken token = 1; jio.brain.proto.quantity.BrainQuantitySchema quantity = 2; optional jio.brain.proto.base.BrainToken unit = 3; } ``` #### Step 4 : Source knowledge data in excel/csv form. There can be one or multiple files and each file contain only 1 kind of entity. :::warning Only **csv/excel** data import is supported ::: #### Step 5 : Define column mapping of above excel file. Each column represent either biz id or name or an attribute. #### Step 6 : There will be seperate file for each kind of predicate. Predicate ingestion file will have only two mandatory columns where first column represent the **subject biz_id** and second column represent **object biz_id**. All subsequent columns represent predicate qualifiers. #### Step 7 : :::warning Ingestion of **attribute** qualifier not supported for this release. ::: Define column mapping of predicate qualifiers for above excel file similar to attribute mapping defined above. #### Step 8 : :::danger Entity ingestion should happen prior to predicate ingestion. ::: Upload excel files using brain workbench. This will add entity data to knowledge repository. Transaction Onboarding --- #### Step 1 : Identify data source. It can be either file pushed on azure storage at every predefined interval of time or data coming on some kafka topic. :::warning Only **kafka** and **csv file** on azure blob storage is supported ::: ```protobuf= message BrainProcessSchema { jio.brain.proto.base.BrainToken token = 1; string input_topic = 2; jio.brain.proto.event.BrainEventSchema input_event_schema = 3; map<string, jio.brain.proto.event.BrainEventSchema> output_event_schema = 4; jio.brain.proto.base.BrainProcessType brain_process_type = 5; oneof config { BrainEnrichProcessSchema enrich = 6; BrainFilterProcessSchema filter = 7; BrainPivotProcessSchema pivot = 8; BrainReduceProcessSchema reduce = 9; BrainIngestProcessSchema ingest = 10; BrainQuantizeProcessSchema quantize = 11; BrainComputeProcessSchema compute = 12; BrainFunctionProcessSchema function = 13; BrainRepositoryProcessSchema repository = 14; } } message BrainIngestProcessSchema { oneof source { KafkaTransport kafka_transport = 2; FileTransport file_transport = 3; JsonFileTransport json_transport = 4; BlobStorageTransport blob_transport = 5; } } message KafkaTransport { string broker_host = 1; uint32 broker_port = 2; repeated FieldMapping mappings = 3; } message BlobStorageTransport { string bucket_name = 1; string prefix = 2; string suffix = 3; string secret_key = 4; string access_key = 5; repeated FieldMapping mappings = 6; } ``` #### Step 2 : Each field in csv file or in kafka event map to either biz id of entity, attribute of entity or property of transaction event. ```protobuf= message FieldMapping { uint32 field_index = 1; // column index in case of csv or excel string field_name = 2; // key name in case of kafka string column_unit = 3; // unit of this column jio.brain.proto.base.BrainInputDataType input_data_type = 4; // data type of input - will always be string in case of csv string format = 5; // date format or number format in case of date or number FieldType field_type = 6; bool is_optional = 7; oneof element { BizIdField entity_biz_id = 8; AttributeField entity_attribute = 9; AttributeQualifierField entity_attribute_qualifier = 10; PropertyField property = 11; } } ``` #### Step 3 : Define transaction event schema which is result of ingestion process. ```protobuf= message BrainEventSchema { jio.brain.proto.base.BrainToken token = 1; oneof event_schema_is_one_of { BrainIngestionEventSchema ingestion_event = 2; BrainTransactionEventSchema transaction_event = 3; BrainIotSensorEventSchema iot_event = 4; BrainEventKeyValueSchema key_value_event = 5; // same as pivot event BrainEventFeatureKeyValueSchema feature_event = 6; BrainTextEventSchema text_event = 7; BrainAudioEventSchema audio_event = 8; BrainImageEventSchema image_event = 9; BrainVideoEventSchema video_event = 10; BrainClassificationEventSchema classification_event = 11; BrainRegressionEventSchema regression_event = 12; BrainOutlierEventSchema outlier_event = 13; BrainRecommendationEventSchema recommendation_event = 14; BrainDecisionEventSchema decision_event = 15; BrainMetricEventSchema metric_event = 16; } } message BrainTransactionEventSchema { BrainEntityStoreSchema entity = 1; map<string, BrainEventPropertySchema> property = 2; } message BrainIotSensorEventSchema { BrainEntityStoreSchema entity = 1; // information about sensor id google.protobuf.Timestamp time_stamp = 2; map<string, BrainEventPropertySchema> property = 3; } message BrainEntityStoreSchema { // key = mid(/m/<vertical>/<domain>/entity/<entity-type>) map<string, jio.brain.proto.entity.BrainEntitySchema> entity = 1; } ``` Feature definition and DAG --- #### Step 1 : Identify important features that will be required to run different machine learning models, rule engine or optimization. Also identify feature family. ```protobuf= message BrainEventFeatureSchema { jio.brain.proto.base.BrainToken token = 1; jio.brain.proto.quantity.BrainQuantitySchema quantity = 2; optional jio.brain.proto.base.BrainToken unit = 3; jio.brain.proto.base.BrainTimeWindowType time_window = 4; } message BrainFeatureFamilySchema { jio.brain.proto.base.BrainToken token = 1; // feature_family_token repeated string features = 2; } ``` #### Step 2 : Using brain os building blocks create a pseudocode defining data transformation from ingestion to target features in form of DAG ##### Processes ```protobuf= message BrainProcessSchema { jio.brain.proto.base.BrainToken token = 1; string input_topic = 2; jio.brain.proto.event.BrainEventSchema input_event_schema = 3; map<string, jio.brain.proto.event.BrainEventSchema> output_event_schema = 4; // key = output_topic, value = event key in dictionary jio.brain.proto.base.BrainProcessType brain_process_type = 5; oneof config { BrainEnrichProcessSchema enrich = 6; BrainFilterProcessSchema filter = 7; BrainPivotProcessSchema pivot = 8; BrainReduceProcessSchema reduce = 9; BrainIngestProcessSchema ingest = 10; BrainQuantizeProcessSchema quantize = 11; BrainComputeProcessSchema compute = 12; BrainFunctionProcessSchema function = 13; BrainRepositoryProcessSchema repository = 14; } } ``` #### Step 3 : Define input and output event schema for each processes in DAG ```protobuf= message BrainEventKeySchema { BrainEntityStoreSchema entity = 1; // key = mid(/m/<vertical>/<domain>/<event>/<context>) map<string, BrainEventContextSchema> context = 2; } message BrainEventValueSchema { BrainEntityStoreSchema entity = 1; // key = mid(/m/<vertical>/<domain>/<event>/<property>) map<string, BrainEventPropertySchema> property = 2; } message BrainEventKeyValueSchema { BrainEventKeySchema key = 1; BrainEventValueSchema value = 2; } message BrainEventFeatureKeyValueSchema { BrainEventKeySchema key = 1; BrainEventFeatureValueSchema value = 2; } message BrainEventFeatureValueSchema { // key = mid(/m/<vertical>/<domain>/<event>/<property>) jio.brain.proto.feature.BrainFeatureSetSchema features = 1; jio.brain.proto.entity.BrainAttributeSetSchema attribute_schema = 2; } message BrainEntityStoreSchema { // key = mid(/m/<vertical>/<domain>/entity/<entity-type>) map<string, jio.brain.proto.entity.BrainEntitySchema> entity = 1; } message BrainEventContextSchema { jio.brain.proto.base.BrainToken token = 1; jio.brain.proto.quantity.BrainQuantitySchema quantity = 2; // BrainToken unit = 3; } message BrainEventPropertySchema { jio.brain.proto.base.BrainToken token = 1; jio.brain.proto.quantity.BrainQuantitySchema quantity = 2; optional jio.brain.proto.base.BrainToken unit = 3; } ``` #### Step 4 : Define configuration of each process in brain ui workbench ##### Enrich ```protobuf= message BrainEnrichProcessSchema { string output_topic = 1; EnrichAttributesInstance attribute = 2; EnrichPredicateInstance predicate = 3; } message EnrichAttributesInstance { map<string, jio.brain.proto.types.BrainStrVector> attribute = 1; } message EnrichPredicateInstance { map<string, jio.brain.proto.types.BrainStrVector> predicate = 1; } ``` ##### Filter ```protobuf= message BrainFilterProcessSchema { string input_topic = 1; repeated FilterInstance instances = 2; message FilterInstance { string filter_name = 1; string success_output_topic = 2; string failure_output_topic = 3; string filter_expression = 4; // key.attribute.customer.type == "premium" && value.property.invoice.total > 1000 } } ``` ##### Pivot ```protobuf= message BrainPivotProcessSchema { string input_topic = 1; repeated PivotInstance instances = 2; } message PivotInstance { string output_topic = 1; string output_event_topic = 2; BrainPivotKeyConfig key_config = 3; BrainPivotValueConfig value_config = 4; } message BrainPivotKeyConfig { repeated string entities = 1; repeated string attributes = 2; map<string, string> contexts = 3; } message BrainPivotValueConfig { repeated string entities = 1; repeated string attributes = 2; map<string, string> properties = 3; } ``` ##### Reduce ```protobuf= message BrainReduceProcessSchema { repeated ReduceInstance instances = 1; } message ReduceInstance { repeated AggregateCondition aggregate_condition = 1; string output_topic = 2; string output_event_schema = 3; optional jio.brain.proto.quantity.BrainTimeInstance start_time = 4; optional jio.brain.proto.quantity.BrainTimeInstance end_time = 5; uint32 window_time_minutes = 6; // 10-10:30 , 10:15-10:45 jio.brain.proto.base.BrainTimeWindowType time_window = 7; } message AggregateCondition { optional string input_property = 1; optional string output_property = 2; optional string count_property = 3; AggregateConditionType type = 4; enum AggregateConditionType { BRAIN_AGGREGATION_SUM = 0; BRAIN_AGGREGATION_AVERAGE = 1; BRAIN_AGGREGATION_COUNT = 2; BRAIN_AGGREGATION_MIN = 3; BRAIN_AGGREGATION_MAX = 4; BRAIN_AGGREGATION_SLOPE = 5; BRAIN_AGGREGATION_PRODUCT = 6; BRAIN_AGGREGATION_DISTRIBUTION = 7; } } ``` ##### Compute ```protobuf= message BrainComputeProcessSchema { string output_event_schema = 1; string output_topic = 2; repeated ComputeInstance instances = 3; } message ComputeInstance { FieldType type = 1; string compute_expression = 2; // (product.mrp - product.discount) * product.quantity + product.gst ( BODMAS ) string output_property_name=3; // product.price or bill_amount enum FieldType { attribute=0; property=1; } } ``` ##### Quantize ```protobuf= message BrainQuantizeProcessSchema { string output_event_schema = 1; string output_topic = 2; repeated QuantizeInstance instances = 3; } message QuantizeInstance { InputPropertyType type = 1; string input_property = 2; string output_property = 3; enum InputPropertyType { BRAIN_QUANTIZE_TEMPORAL = 0; BRAIN_QUANTIZE_SPATIAL = 1; BRAIN_QUANTIZE_BINNED = 2; } } ``` ###### tags: `onboarding` `schema`

    Import from clipboard

    Paste your markdown or webpage here...

    Advanced permission required

    Your current role can only read. Ask the system administrator to acquire write and comment permission.

    This team is disabled

    Sorry, this team is disabled. You can't edit this note.

    This note is locked

    Sorry, only owner can edit this note.

    Reach the limit

    Sorry, you've reached the max length this note can be.
    Please reduce the content or divide it to more notes, thank you!

    Import from Gist

    Import from Snippet

    or

    Export to Snippet

    Are you sure?

    Do you really want to delete this note?
    All users will lose their connection.

    Create a note from template

    Create a note from template

    Oops...
    This template has been removed or transferred.
    Upgrade
    All
    • All
    • Team
    No template.

    Create a template

    Upgrade

    Delete template

    Do you really want to delete this template?
    Turn this template into a regular note and keep its content, versions, and comments.

    This page need refresh

    You have an incompatible client version.
    Refresh to update.
    New version available!
    See releases notes here
    Refresh to enjoy new features.
    Your user state has changed.
    Refresh to load new user state.

    Sign in

    Forgot password

    or

    By clicking below, you agree to our terms of service.

    Sign in via Facebook Sign in via Twitter Sign in via GitHub Sign in via Dropbox Sign in with Wallet
    Wallet ( )
    Connect another wallet

    New to HackMD? Sign up

    Help

    • English
    • 中文
    • Français
    • Deutsch
    • 日本語
    • Español
    • Català
    • Ελληνικά
    • Português
    • italiano
    • Türkçe
    • Русский
    • Nederlands
    • hrvatski jezik
    • język polski
    • Українська
    • हिन्दी
    • svenska
    • Esperanto
    • dansk

    Documents

    Help & Tutorial

    How to use Book mode

    Slide Example

    API Docs

    Edit in VSCode

    Install browser extension

    Contacts

    Feedback

    Discord

    Send us email

    Resources

    Releases

    Pricing

    Blog

    Policy

    Terms

    Privacy

    Cheatsheet

    Syntax Example Reference
    # Header Header 基本排版
    - Unordered List
    • Unordered List
    1. Ordered List
    1. Ordered List
    - [ ] Todo List
    • Todo List
    > Blockquote
    Blockquote
    **Bold font** Bold font
    *Italics font* Italics font
    ~~Strikethrough~~ Strikethrough
    19^th^ 19th
    H~2~O H2O
    ++Inserted text++ Inserted text
    ==Marked text== Marked text
    [link text](https:// "title") Link
    ![image alt](https:// "title") Image
    `Code` Code 在筆記中貼入程式碼
    ```javascript
    var i = 0;
    ```
    var i = 0;
    :smile: :smile: Emoji list
    {%youtube youtube_id %} Externals
    $L^aT_eX$ LaTeX
    :::info
    This is a alert area.
    :::

    This is a alert area.

    Versions and GitHub Sync
    Get Full History Access

    • Edit version name
    • Delete

    revision author avatar     named on  

    More Less

    Note content is identical to the latest version.
    Compare
      Choose a version
      No search result
      Version not found
    Sign in to link this note to GitHub
    Learn more
    This note is not linked with GitHub
     

    Feedback

    Submission failed, please try again

    Thanks for your support.

    On a scale of 0-10, how likely is it that you would recommend HackMD to your friends, family or business associates?

    Please give us some advice and help us improve HackMD.

     

    Thanks for your feedback

    Remove version name

    Do you want to remove this version name and description?

    Transfer ownership

    Transfer to
      Warning: is a public team. If you transfer note to this team, everyone on the web can find and read this note.

        Link with GitHub

        Please authorize HackMD on GitHub
        • Please sign in to GitHub and install the HackMD app on your GitHub repo.
        • HackMD links with GitHub through a GitHub App. You can choose which repo to install our App.
        Learn more  Sign in to GitHub

        Push the note to GitHub Push to GitHub Pull a file from GitHub

          Authorize again
         

        Choose which file to push to

        Select repo
        Refresh Authorize more repos
        Select branch
        Select file
        Select branch
        Choose version(s) to push
        • Save a new version and push
        • Choose from existing versions
        Include title and tags
        Available push count

        Pull from GitHub

         
        File from GitHub
        File from HackMD

        GitHub Link Settings

        File linked

        Linked by
        File path
        Last synced branch
        Available push count

        Danger Zone

        Unlink
        You will no longer receive notification when GitHub file changes after unlink.

        Syncing

        Push failed

        Push successfully