Skip to content

gesad-lab/baes_demo

Repository files navigation

🧠 BAE Academic System - Scenario 1 Implementation

Business Autonomous Entities: Adaptive Academic System

This project implements the Scenario 1: Initial System Generation phase of the BAE (Business Autonomous Entities) proof of concept, as specified in the doctoral thesis "Agentes Baseados em LLM como Entidades Autônomas de Negócio: Uma Nova Arquitetura para Construção Adaptativa de Sistemas de Informação".

🎯 Project Status: Scenario 1 Core Components ✅

✅ Completed Components

1. Student BAE (Business Autonomous Entity)

  • ✅ Domain entity representative for "Student" entity
  • ✅ Natural language business request interpretation
  • ✅ Domain knowledge preservation and semantic coherence
  • ✅ SWEA coordination plan generation
  • ✅ Business vocabulary management
  • ✅ Context adaptation for different organizational settings

2. OpenAI GPT-4o-mini Integration

  • ✅ Domain-focused LLM client wrapper
  • ✅ Semantic coherence validation capabilities
  • ✅ Business request interpretation methods
  • ✅ Code generation with domain entity focus

3. Context Store

  • ✅ Domain knowledge persistence
  • ✅ Business vocabulary preservation
  • ✅ Agent memory management
  • ✅ Evolution history tracking (for Scenario 2)

4. Base Agent Framework

  • ✅ Common agent functionality (BAE + SWEA)
  • ✅ Memory management and interaction logging
  • ✅ Error handling and performance metrics
  • ✅ Task validation and response formatting

5. Prompt Templates

  • ✅ Student schema generation (domain entity focus)
  • ✅ Backend generation (SWEA coordination)
  • ✅ Frontend generation (business vocabulary)

6. Test Suite

  • ✅ All core components validated
  • ✅ Scenario 1 workflow simulation
  • ✅ 5/5 tests passing

🔬 Scenario 1: Initial System Generation

Objective: Demonstrate automatic creation of functional system from natural language through domain entity autonomy.

Input: HBE request: "Create a system to manage students with name, registration number, and course"

Student BAE Process:

  1. 🧠 Interpret business request using domain knowledge
  2. 📋 Extract domain attributes and business vocabulary
  3. 🎯 Create SWEA coordination plan maintaining semantic coherence
  4. 📚 Preserve domain knowledge for reusability
  5. ✅ Validate coordination plan completeness

Expected SWEA Coordination:

  • Step 1: StudentBAE generates domain entity schema
  • Step 2: BackendSWEA creates FastAPI backend
  • Step 3: DatabaseSWEA creates persistence layer
  • Step 4: FrontendSWEA generates Streamlit UI

Success Criteria:

  • ⏱️ Generation time < 3 minutes
  • ✅ 100% functional system
  • 🎯 Domain entity autonomy maintained
  • 📚 Semantic coherence preserved

🏗️ Architecture

HBE (Human Business Expert)
    ↓ (natural language with business vocabulary)
Student BAE (Domain Entity Representative)
    ↓ (domain interpretation & SWEA coordination)
Context Store (Domain Knowledge Preservation)
    ↓ (coordination plan)
SWEA Agents (BackendSWEA, FrontendSWEA, DatabaseSWEA, TestSWEA)
    ↓ (generated artifacts with semantic coherence)
Functional System (API + UI + Database)

🛠️ Technology Stack

  • Python 3.11+ - Core implementation language
  • OpenAI GPT-4o-mini - Domain entity reasoning and code generation
  • FastAPI - Backend framework (to be generated by SWEA)
  • Streamlit - Frontend framework (to be generated by SWEA)
  • SQLite - Database (to be generated by SWEA)
  • Pydantic - Domain entity validation
  • LangGraph - Agent orchestration (planned)

🚀 Quick Start

1. Setup Environment

cd bae_academic_system
pip install -r requirements.txt

2. Configure OpenAI API Key

Create a .env file or update config.py:

OPENAI_API_KEY=your_openai_api_key_here
OPENAI_MODEL=gpt-4o-mini

3. Run Core Tests

python test_scenario1.py

Expected output: 5/5 tests passed

4. Test Student BAE Independently

from agents.student_bae import StudentBAE

# Initialize Student BAE
student_bae = StudentBAE()

# Test business request interpretation
result = student_bae.handle_task("interpret_business_request", {
    "request": "Create a system to manage students with name, registration number, and course",
    "context": "academic"
})

print(result)

📋 Next Implementation Steps

Phase 2: Complete SWEA Agents (Week 2)

1. BackendSWEA Implementation

  • FastAPI code generation with domain focus
  • SQLAlchemy model generation
  • Database migration scripts
  • API endpoint generation with business vocabulary

2. FrontendSWEA Implementation

  • Streamlit UI generation with business terminology
  • Form creation for domain entity operations
  • Business-friendly error handling
  • Real-time data refresh capabilities

3. DatabaseSWEA Implementation

  • Database schema generation
  • Business rule preservation in constraints
  • Domain integrity validation
  • Migration script generation

4. Runtime Kernel Implementation

  • BAE-SWEA orchestration
  • Dynamic file generation and loading
  • Real-time system assembly
  • Performance monitoring

Phase 3: Complete Scenario 1 Execution (Week 3)

1. End-to-End Integration

  • Complete workflow execution
  • File generation and deployment
  • System startup automation
  • Performance validation

2. Scenario 1 Validation

  • <3 minute generation time
  • 100% functional system
  • Semantic coherence validation
  • Business vocabulary preservation

3. Preparation for Scenario 2

  • Runtime evolution capabilities
  • Domain knowledge preservation
  • Migration script generation
  • Zero-downtime updates

🧪 Testing Framework

Current Test Coverage

✅ OpenAI Client - LLM integration ready
✅ Context Store - Domain knowledge preservation
✅ Base Agent - Agent framework functional
✅ Student BAE - Domain entity representative working
✅ Scenario 1 Workflow - Coordination plan validated

Test Scenarios

  1. Unit Tests - Individual component validation
  2. Integration Tests - Agent interaction validation
  3. Domain Tests - Business vocabulary preservation
  4. Performance Tests - Generation time validation
  5. End-to-End Tests - Complete workflow validation

📊 Success Metrics (Scenario 1)

Quantitative Metrics

  • ⏱️ Response Time: < 3 minutes (target)
  • Success Rate: 100% functional system
  • 🎯 Domain Coherence: Semantic alignment validation
  • 📚 Vocabulary Preservation: Business terminology maintained

Qualitative Metrics

  • 🧠 Domain Entity Autonomy: Student BAE operates independently
  • 🔗 Semantic Coherence: Business concepts aligned with technical artifacts
  • 🎭 HBE Usability: Natural language interaction successful
  • 🔄 SWEA Coordination: Effective agent collaboration

📚 Documentation References

  • docs/PROOF_OF_CONCEPT.md - Complete scenario specifications
  • docs/BAE_IMPLEMENTATION_GUIDE.md - Technical implementation details
  • docs/IMPLEMENTATION_CHECKLIST.md - 3-week execution plan
  • docs/PROMPT_TEMPLATES.md - LLM prompt specifications

🤝 Domain Entity Focus

This implementation emphasizes the innovative BAE approach where:

  1. Student BAE represents the domain entity as a living, autonomous agent
  2. Business vocabulary is preserved throughout all technical artifacts
  3. Semantic coherence is maintained between domain concepts and code
  4. Domain knowledge is preserved for cross-organizational reusability
  5. SWEA agents are coordinated by BAEs, not operating independently

This differs from traditional LMA approaches by focusing on domain entity autonomy rather than software engineering role simulation.


🎉 Achievement Summary

✅ Scenario 1 Core Components Successfully Implemented

  • 🧠 Student BAE functioning as domain entity representative
  • 🔗 OpenAI GPT-4o-mini integration ready for domain reasoning
  • 📚 Domain knowledge preservation and semantic coherence capabilities
  • 🎯 SWEA coordination planning with business vocabulary focus
  • ⚡ All tests passing (5/5) with sub-second performance

Ready for next phase: SWEA agent implementation and complete Scenario 1 execution.


Project Status: 🟢 Phase 1 Complete - Ready for Phase 2 SWEA Implementation

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 2

  •  
  •  

Languages