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".
- ✅ 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
- ✅ Domain-focused LLM client wrapper
- ✅ Semantic coherence validation capabilities
- ✅ Business request interpretation methods
- ✅ Code generation with domain entity focus
- ✅ Domain knowledge persistence
- ✅ Business vocabulary preservation
- ✅ Agent memory management
- ✅ Evolution history tracking (for Scenario 2)
- ✅ Common agent functionality (BAE + SWEA)
- ✅ Memory management and interaction logging
- ✅ Error handling and performance metrics
- ✅ Task validation and response formatting
- ✅ Student schema generation (domain entity focus)
- ✅ Backend generation (SWEA coordination)
- ✅ Frontend generation (business vocabulary)
- ✅ All core components validated
- ✅ Scenario 1 workflow simulation
- ✅ 5/5 tests passing
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:
- 🧠 Interpret business request using domain knowledge
- 📋 Extract domain attributes and business vocabulary
- 🎯 Create SWEA coordination plan maintaining semantic coherence
- 📚 Preserve domain knowledge for reusability
- ✅ 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
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)
- 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)
cd bae_academic_system
pip install -r requirements.txt
Create a .env
file or update config.py
:
OPENAI_API_KEY=your_openai_api_key_here
OPENAI_MODEL=gpt-4o-mini
python test_scenario1.py
Expected output: 5/5 tests passed ✅
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)
- FastAPI code generation with domain focus
- SQLAlchemy model generation
- Database migration scripts
- API endpoint generation with business vocabulary
- Streamlit UI generation with business terminology
- Form creation for domain entity operations
- Business-friendly error handling
- Real-time data refresh capabilities
- Database schema generation
- Business rule preservation in constraints
- Domain integrity validation
- Migration script generation
- BAE-SWEA orchestration
- Dynamic file generation and loading
- Real-time system assembly
- Performance monitoring
- Complete workflow execution
- File generation and deployment
- System startup automation
- Performance validation
- <3 minute generation time
- 100% functional system
- Semantic coherence validation
- Business vocabulary preservation
- Runtime evolution capabilities
- Domain knowledge preservation
- Migration script generation
- Zero-downtime updates
✅ 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
- Unit Tests - Individual component validation
- Integration Tests - Agent interaction validation
- Domain Tests - Business vocabulary preservation
- Performance Tests - Generation time validation
- End-to-End Tests - Complete workflow validation
- ⏱️ Response Time: < 3 minutes (target)
- ✅ Success Rate: 100% functional system
- 🎯 Domain Coherence: Semantic alignment validation
- 📚 Vocabulary Preservation: Business terminology maintained
- 🧠 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
docs/PROOF_OF_CONCEPT.md
- Complete scenario specificationsdocs/BAE_IMPLEMENTATION_GUIDE.md
- Technical implementation detailsdocs/IMPLEMENTATION_CHECKLIST.md
- 3-week execution plandocs/PROMPT_TEMPLATES.md
- LLM prompt specifications
This implementation emphasizes the innovative BAE approach where:
- Student BAE represents the domain entity as a living, autonomous agent
- Business vocabulary is preserved throughout all technical artifacts
- Semantic coherence is maintained between domain concepts and code
- Domain knowledge is preserved for cross-organizational reusability
- 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.
✅ 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