Production-ready autonomous AI agent for safety-critical requirements engineering across automotive, defence, medtech, and railways domains.
requirementAgent is a LangGraph-based multi-agent system that automates the complete requirements engineering lifecycle for mission-critical software systems. It provides mathematically rigorous verification, automated safety analysis, and full bidirectional traceability β all while supporting both local (Ollama, LM Studio) and cloud (NVIDIA NIM, OpenRouter, Anthropic, OpenAI, Cerebras, Groq, Gemini, Azure OpenAI, AWS Bedrock) LLM providers.
| Capability | Description |
|---|---|
| EARS Parsing | Syntactic validation, auto-rewrite, and ambiguity detection per Easy Approach to Requirements Syntax |
| Formal Verification | EARS β LTL/CTL β SMT-LIB v2 β Z3 SMT solver for contradiction detection and edge-case synthesis |
| Safety Analysis | Automated Functional Hazard Assessment (FHA) per ISO 26262, IEC 62304, EN 50128, DO-178C |
| Threat Modeling | STRIDE analysis + MITRE ATT&CK mapping + security controls verification |
| Traceability | Bidirectional SYS.2 β SWE.1 β SWE.2 β SWE.3 β Code β Tests matrices |
| Multi-Provider LLM | 12+ providers with intelligent routing, circuit breakers, and cost control |
| Four-Tier Memory | Working, Episodic, Semantic (vector+graph), Procedural (CoALA architecture) |
| Observability | Full Langfuse tracing, evaluation datasets, cost tracking, PII masking |
| Interoperability | A2A, AGNTCY ACP, OASF schema, OpenWiki documentation |
| Compliance | EU AI Act (high-risk), EU CRA (Class II), GDPR, ASPICE v4.0 |
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β requirementAgent β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ€
β ββββββββββββ ββββββββββββ ββββββββββββ ββββββββββββ ββββββββββββ β
β β Ingest ββ β EARS ββ β Formal ββ β Safety/ ββ β Trace β β
β β Node β β Parser β β Verify β β Security β β Compiler β β
β ββββββββββββ ββββββββββββ ββββββββββββ ββββββββββββ ββββββββββββ β
β β β β β β β
β βΌ βΌ βΌ βΌ βΌ β
β ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ β
β β LangGraph Orchestrator β β
β β β’ State management β’ HITL gates β’ Checkpointing β’ Retry logic β β
β ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ β
β β β
ββββββββββββββββββββββββββββββββββββββΌβββββββββββββββββββββββββββββββββββββββββ€
β LLM Router (12 providers) β Memory Manager (4 tiers) β
β β’ OpenAI, Anthropic, Groq β β’ Working (in-context) β
β β’ NVIDIA NIM, Cerebras, Groq β β’ Episodic (vector + time-series) β
β β’ Gemini, Azure OpenAI, Bedrock β β’ Semantic (vector + knowledge graph)β
β β’ Ollama, LM Studio (local) β β’ Procedural (skills + heuristics) β
β β β
ββββββββββββββββββββββββββββββββββββββ€
β Observability β Interoperability β
β β’ Langfuse (traces, evals, cost) β β’ A2A (Agent2Agent) β
β β’ OTel export for AGNTCY β β’ ACP (Agent Connect Protocol) β
β β’ PII masking β β’ OASF (Open Agentic Schema) β
ββββββββββββββββββββββββββββββββββββββ΄βββββββββββββββββββββββββββββββββββββββββ
| Domain | Safety Standard | Security Standard | Quality Standard | Criticality Levels |
|---|---|---|---|---|
| Automotive | ISO 26262 | ISO 21434 | ASPICE v4.0 | QM, ASIL-AβD |
| Defence/Aerospace | DO-178C, MIL-STD-882E | NIST SP 800-53, CNSSI 1253 | IEEE 29148 | DAL AβE |
| Medtech | IEC 62304 | FDA Cybersecurity Guidance | ISO 13485 | Class AβC |
| Railways | EN 50128/50657 | CLC/TS 50701 | CENELEC | SIL 0β4 |
# Clone and install
git clone https://github.com/SoftwareDevLabs/requirementAgent.git
cd requirementAgent
pip install -r requirements.txt
# Install Z3 for formal verification
pip install z3-solver
# Configure environment
cp .env.template .env
# Edit .env with your API keys# config.yml - Key sections
agent:
name: "requirementAgent"
version: "1.0.0"
role: ["provider"] # EU AI Act role
llm:
router:
default_provider: "openrouter"
task_routing:
formal_verification: "anthropic:claude-3.5-sonnet"
ears_parsing: "openrouter:google/gemini-flash-1.5"
safety_analysis: "openai:gpt-4o"
fallback_chain: ["openrouter", "anthropic", "openai", "groq", "ollama"]
cost_budget_usd_per_day: 50.0
memory:
episodic:
backend: "postgres-pgvector"
retention_days: 90
semantic:
backend: "mem0"
graph_backend: "neo4j"
protocols:
a2a:
enabled: true
signed: true
acp:
enabled: true# Start the agent server
python -m src.agents.requirement_agent
# Or run a quick validation
python examples/automotive_braking_example.pyimport asyncio
from src.agents.requirement_agent import create_requirement_agent
async def main():
agent = create_requirement_agent({
"domain": "automotive",
"config": {"llm": {"router": {"default_provider": "openrouter"}}}
})
requirements = [
{"id": "REQ-001", "text": "The braking system shall apply brakes within 100 milliseconds"},
{"id": "REQ-002", "text": "When obstacle detected, the collision avoidance system shall initiate emergency braking"},
{"id": "REQ-003", "text": "While vehicle speed > 10 km/h, the door control shall lock all doors"},
]
result = await agent.run(requirements, domain="automotive")
# Access compliance package
pkg = result["compliance_package"]
print(f"EARS Compliance: {pkg['compliance_evidence']['ears_compliance_rate']:.1%}")
print(f"Formal Consistency: {pkg['formal_verification']['is_consistent']}")
print(f"Hazards Found: {pkg['compliance_evidence']['hazards_identified']}")
print(f"Threats Found: {pkg['compliance_evidence']['threats_identified']}")
asyncio.run(main())async for chunk in agent.run_streaming(requirements, domain="medtech"):
if "current_phase" in chunk:
print(f"Phase: {chunk['current_phase']}")
if "compliance_package" in chunk:
print("β
Complete!")from src.pipeline.formal_verifier import create_formal_verifier
from src.pipeline.ears_parser import create_ears_parser
ears = create_ears_parser()
verifier = create_formal_verifier({"timeout_ms": 30000})
# Parse and verify
reqs = [ears.parse("The valve shall remain closed when pressure high")]
validated = [ears.validate(r) for r in reqs]
result = verifier.verify_requirements(validated)
if result.is_consistent:
print("β
No contradictions found")
else:
print(f"β Contradiction: {result.unsat_core}")
print(f"Counterexample: {result.model}")from src.pipeline.safety_auditor import create_fh_analyzer, create_threat_analyzer
fha = create_fh_analyzer("automotive")
threat = create_threat_analyzer("automotive")
fha_result = fha.analyze(validated_reqs)
threat_result = threat.analyze(validated_reqs)
print(f"Hazards: {len(fha_result.hazards)}")
print(f"Threats: {len(threat_result.threats)}")
print(f"MITRE Techniques: {list(threat_result.mitre_mapping.keys())}")requirementAgent/
βββ config.yml # Main configuration
βββ .env.template # Environment template
βββ requirements.txt # Python dependencies
βββ setup.py # Package setup
βββ SPEC.md # Technical specification
βββ CHANGELOG.md # Version history
βββ README.md # This file
βββ docs/ # Documentation
β βββ architecture.md
β βββ configuration.md
β βββ deployment.md
β βββ extension.md
βββ memory/ # Domain knowledge bases
β βββ automotive/
β βββ defence/
β βββ medtech/
β βββ railways/
βββ src/
β βββ agents/
β β βββ requirement_agent.py # LangGraph orchestrator
β βββ llm/
β β βββ schemas.py # Message/Tool/Completion types
β β βββ router.py # Intelligent provider routing
β β βββ providers/ # 12 provider implementations
β βββ memory/
β β βββ __init__.py # 4-tier memory manager
β β βββ working.py # In-context working memory
β β βββ episodic.py # Vector + time-series
β β βββ semantic.py # Vector + knowledge graph
β β βββ procedural.py # Skills + heuristics
β βββ pipeline/
β β βββ ears_parser.py # EARS syntactic validator
β β βββ formal_verifier.py # LTLβZ3 verification
β β βββ safety_auditor.py # FHA + STRIDE + MITRE
β β βββ trace_compiler.py # Bidirectional traceability
β βββ protocols/
β β βββ a2a_acp.py # A2A/ACP/OASF interfaces
β βββ observability/
β βββ langfuse.py # Tracing, evals, cost tracking
βββ tests/
β βββ unit/
β β βββ pipeline/ # EARS, formal, safety tests
β βββ integration/
β β βββ test_full_pipeline.py # End-to-end tests
β βββ smoke/ # Quick health checks
βββ examples/
β βββ automotive_braking_example.py
β βββ medtech_infusion_pump.py
β βββ railways_signaling.py
β βββ defence_flight_control.py
βββ .github/workflows/ # CI/CD pipelines
# Run all tests
pytest
# Unit tests only
pytest tests/unit/
# Integration tests
pytest tests/integration/
# Smoke tests
pytest tests/smoke/
# With coverage
pytest --cov=src --cov-report=html
# Specific test file
pytest tests/unit/pipeline/test_ears_parser.py -v| Layer | Target |
|---|---|
| Unit | β₯ 85% |
| Integration | β₯ 70% |
| E2E | β₯ 60% |
| Provider | Env Var | Base URL | Models |
|---|---|---|---|
| OpenAI | OPENAI_API_KEY |
https://api.openai.com/v1 |
gpt-4o, gpt-4o-mini, o1 |
| Anthropic | ANTHROPIC_API_KEY |
https://api.anthropic.com |
claude-3.5-sonnet, haiku, opus |
| OpenRouter | OPENROUTER_API_KEY |
https://openrouter.ai/api/v1 |
300+ models |
| NVIDIA NIM | NVIDIA_NIM_API_KEY |
https://integrate.api.nvidia.com/v1 |
Nemotron, Llama |
| Cerebras | CEREBRAS_API_KEY |
https://api.cerebras.ai/v1 |
Llama 3.1 70B/405B |
| Groq | GROQ_API_KEY |
https://api.groq.com/openai/v1 |
Llama, Mixtral, Gemma |
| Gemini | GEMINI_API_KEY |
https://generativelanguage.googleapis.com |
1.5 Pro/Flash |
| Azure OpenAI | AZURE_OPENAI_API_KEY |
https://{resource}.openai.azure.com |
GPT-4o, GPT-4o-mini |
| AWS Bedrock | AWS_ACCESS_KEY_ID + AWS_SECRET_ACCESS_KEY |
Regional | Claude, Llama, Nova |
| Ollama | OLLAMA_BASE_URL (default: http://localhost:11434/v1) |
Local | Any GGUF |
| LM Studio | LM_STUDIO_BASE_URL (default: http://localhost:1234/v1) |
Local | Any GGUF |
# Dockerfile included
docker build -t requirementagent .
docker run -p 8000:8000 --env-file .env requirementagent# k8s/deployment.yaml
apiVersion: apps/v1
kind: Deployment
metadata:
name: requirementagent
spec:
replicas: 3
template:
spec:
containers:
- name: requirementagent
image: requirementagent:latest
envFrom:
- secretRef:
name: requirementagent-secrets- Fork the repository
- Create a feature branch (
git checkout -b feature/amazing-feature) - Make changes with tests
- Run full test suite (
pytest) - Submit PR with description
- Type hints required for all public APIs
- Docstrings in Google style
- Line length β€ 100 chars
- Imports sorted: stdlib β third-party β local
- Tests required for new functionality
Apache 2.0 β See LICENSE.md
- Z3 Theorem Prover (Microsoft Research) β Formal verification backbone
- LangGraph (LangChain) β Workflow orchestration
- Langfuse β Observability platform
- EARS (Alistair Mavin) β Requirements syntax standard
- CoALA (Sumers et al., Princeton) β Four-tier memory architecture
- A2A/ACP/OASF (Linux Foundation/AGNTCY) β Interoperability protocols
- Issues: GitHub Issues
- Discussions: GitHub Discussions
- Email: info@softwaredevlabs.com
- Documentation: docs/
Built with β€οΈ by SoftwareDevLabs for the safety-critical engineering community.