Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
314 changes: 52 additions & 262 deletions examples/cli/README.md
Original file line number Diff line number Diff line change
@@ -1,262 +1,52 @@
# MultiMind CLI Examples

## Compliance and Governance CLI

The `compliance_cli.py` provides a command-line interface for managing compliance and governance features. Here are some example commands:

### Dataset Ingestion

```bash
# Ingest a new dataset with compliance checks
multimind governance ingest \
--dataset-id "customer_support_2024" \
--name "Customer Support Dataset" \
--description "Customer support conversations for AI training" \
--data-categories "personal,sensitive" \
--metadata '{"source": "customer_support_tickets", "preprocessing": "anonymized"}'
```

### Output Validation

```bash
# Validate agent output for compliance
multimind governance validate-output \
--output-id "response_123" \
--content "The customer's account balance is $1,000" \
--user-id "user_123" \
--purpose "customer_support"
```

### Anomaly Monitoring

```bash
# Monitor for compliance anomalies
multimind governance monitor-anomalies \
--start-time "2024-03-01T00:00:00" \
--severity "high,critical"
```

### Compliance Reports

```bash
# Generate monthly compliance report
multimind governance export-logs \
--report-id "monthly_2024_03" \
--period "30d" \
--format "pdf"
```

### DSAR Handling

```bash
# Export user data for DSAR
multimind governance dsar export \
--user-id "user_123" \
--request-id "dsar_2024_001" \
--format "json"

# Erase user data
multimind governance dsar erase \
--user-id "user_123" \
--request-id "erasure_2024_001" \
--verify
```

### Model Version Approval

```bash
# Request approval for a new model version
multimind governance model-approve \
--model-id "invoice-processor-v2" \
--approver "alice@acme.com" \
--metadata '{"version": "2.0.0", "changes": "Improved accuracy"}'
```

### Third-Party Plugin Vetting

```bash
# Register and vet a new plugin
multimind governance plugin-register \
--name "sentiment-analyzer" \
--source "github.com/org/repo" \
--checks "dependency_scan,license_check,cve_lookup"
```

### Continuous Compliance Testing

```bash
# Run nightly compliance test suite
multimind governance test-run \
--suite "nightly-safety" \
--ticket-system "jira" \
--project "COMPLIANCE"
```

### Embedding Drift Detection

```bash
# Check for embedding drift
multimind governance drift-check \
--store "prod-embeddings" \
--threshold 0.15
```

### Risk Score Override

```bash
# Override risk score for a request
multimind governance risk-override \
--request-id "abc123" \
--new-score 0.3 \
--reason "Low sensitivity" \
--officer-id "compliance_officer_001"
```

### Log Chain Verification

```bash
# Verify tamper-evident log chain
multimind governance audit-verify \
--chain-id "chain-789" \
--start-time "2024-03-01T00:00:00" \
--end-time "2024-03-31T23:59:59"
```

### Policy Management

```bash
# Publish new policy version
multimind governance policy-publish \
--policy-file "new-gdpr.rego" \
--version "1.2.0" \
--metadata '{"author": "compliance_team", "changes": "Updated data retention rules"}'
```

### Incident Response

```bash
# Create and handle incident
multimind governance incident-create \
--type "policy-violation" \
--details-file "violation123.json" \
--severity "high" \
--playbook "policy_violation_response"
```

### Consent Management

```bash
# Check for expiring consents
multimind governance consent-check \
--days 7 \
--channels "email,in_app"
```

### DPIA Assignment

```bash
# Assign DPIA review task
multimind governance dpia-assign \
--dataset-id "medical-records" \
--assignee "compliance-team" \
--priority "high" \
--due-days 14
```

## Common Use Cases

1. **Dataset Onboarding**
- Enforce consent checks
- Tag sensitive data
- Trigger DPIA if needed

2. **Pre-training Pipeline**
- Validate data compliance
- Check for required documentation
- Ensure proper consent

3. **Agent Response Validation**
- Check output against schemas
- Verify policy compliance
- Log validation results

4. **Live Monitoring**
- Stream audit logs
- Detect anomalies
- Alert on violations

5. **Compliance Reporting**
- Generate monthly reports
- Track policy violations
- Monitor DPIA status

6. **DSAR Processing**
- Export user data
- Handle erasure requests
- Maintain audit trail

## Additional Use Cases

1. **Model Governance**
- Version approval workflows
- Change tracking
- Audit trail maintenance

2. **Plugin Security**
- Dependency scanning
- License compliance
- Vulnerability assessment

3. **Continuous Testing**
- Automated test suites
- Integration with ticketing
- Failure tracking

4. **Drift Monitoring**
- Embedding distribution analysis
- Threshold-based alerts
- Retraining triggers

5. **Risk Management**
- Score overrides
- Officer approvals
- Audit trail

6. **Log Security**
- Chain verification
- Tamper detection
- Historical analysis

7. **Policy Control**
- Version management
- Hot reloading
- Change tracking

8. **Incident Handling**
- Automated playbooks
- Severity management
- Response coordination

9. **Consent Management**
- Expiry tracking
- Multi-channel notifications
- Renewal workflows

10. **DPIA Management**
- Task assignment
- Priority handling
- Due date tracking

## Requirements

- Python 3.8+
- Click
- MultiMind SDK
- Required dependencies (see requirements.txt)

## Notes

- All commands are asynchronous and use the `asyncio` runtime
- Commands can be integrated into CI/CD pipelines
- Use `--help` with any command to see detailed options
- Consider using environment variables for sensitive configuration
# MultiMindSDK Example CLI Scripts

This folder contains **example CLI scripts** for specific use cases and demos. These are not the main CLI entry points, but serve as templates and learning resources for developers.

## What You'll Find Here

Each script demonstrates how to use the MultiMindSDK CLI features for a particular task, such as:
- Ensemble workflows
- Chat with different models
- Compliance and data analysis
- Knowledge management
- Task runners and usage tracking
- Scientific research and more

## How to Use

- **Run an example script:**
```bash
python examples/cli/<script_name>.py [args]
```
- **See help for a script:**
```bash
python examples/cli/<script_name>.py --help
```

## Example Scripts

| Script Name | Purpose / Use Case |
|------------------------------|---------------------------------------------------|
| ensemble_cli.py | Ensemble agent workflows and voting |
| chat_ollama_cli.py | Chat with Ollama models via CLI |
| chat_with_gpt.py | Chat with OpenAI GPT models via CLI |
| compliance_cli.py | Compliance workflows and validation |
| data_analysis_cli.py | Data analysis workflows |
| knowledge_management_cli.py | Knowledge management and retrieval |
| mcp_workflow.py | MCP workflow orchestration |
| multi_model_wrapper_cli.py | Multi-model wrapper CLI |
| prompt_chain.py | Prompt chaining and orchestration |
| scientific_research_cli.py | Scientific research workflow demo |
| software_development_cli.py | Software development workflow demo |
| task_runner.py | Task runner and orchestration |
| usage_tracking.py | Usage tracking and analytics |
| basic_agent.py | Basic agent CLI example |

## Developer Notes
- These scripts are for learning, prototyping, and extension.
- For main CLI entry points, see the `multimind/cli/` folder and its README.
- Each script is self-contained and can be adapted for your own workflows.

---

Happy experimenting! 🚀
44 changes: 44 additions & 0 deletions examples/evolutionary/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
# Evolutionary Agentic AI Examples

This folder contains **modular, developer-friendly demos** for evolutionary and agentic workflows in MultiMindSDK.

## What You'll Find Here

- **agent_evolution_demo.py**: Run multiple agents in parallel, select the best with a multi-objective judge, and track performance over time.
- **agent_evolution_mutation_demo.py**: Adds mutation—evolve your agent pipeline between rounds and see how performance changes.
- **agent_workflow_demo.py**: Shows how to build and run a simple agent workflow (DAG) using the modular pipeline system.

## Quickstart

1. **Install dependencies** (from the project root):
```bash
pip install -r requirements.txt
```
2. **Run a demo** (from the project root):
```bash
python examples/evolutionary/agent_evolution_demo.py
python examples/evolutionary/agent_evolution_mutation_demo.py
python examples/evolutionary/agent_workflow_demo.py
```

## Modularity & Extensibility

- All examples use **modular agent classes**—swap in your own agents, judges, or memory modules.
- The architecture supports easy extension: add new agents, mutate pipelines, or plug in custom scoring and memory.
- Each script is self-contained but can be combined for more advanced workflows (e.g., hybrid symbolic + evolutionary).

## How to Extend

- **Add new agent strategies**: Subclass `MinimalAgent` or any agent and override the `run` method.
- **Customize judging**: Pass your own judge function or agent to the `AgentArena`.
- **Integrate memory or reasoning**: Use `GraphMemoryAgent`, `ThinkerAgent`, or `SelfReflectAgent` in your pipeline.
- **Experiment with mutation**: Use `MetaControllerAgent` and `AgentMutator` to evolve your agent pipeline.

## More Info

- See the main project docs for architectural details and advanced usage.
- All code is designed for clarity, modularity, and rapid prototyping.

---

Happy hacking! 🚀
Loading