Constitutional AI Agents - Multi-agent platform with governance and ethical decision-making
Project description
Socratic Agents
Socratic Agents - Multi-agent framework with Constitutional AI governance for building trustworthy, accountable AI systems.
Overview
Socratic Agents is a collection of 19+ specialized agents that handle complex tasks like Socratic questioning, code generation, project management, quality control, learning, and conflict resolution.
Key Features:
- Constitutional AI governance with socratic-morality framework
- Multi-agent orchestration with event-driven architecture
- Inter-agent messaging via AgentBus
- Comprehensive agent implementations ready to use
Requirements
- Python 3.10+ (recommended 3.11 or 3.12)
- socratic-morality - Constitutional AI governance framework (included as dependency)
- pydantic>=2.0 - Data validation
Optional Dependencies
- FastAPI - For REST API support (
pip install socratic-agents[api]) - Anthropic SDK - For Claude integration (already included)
Installation
Via PyPI (Recommended)
Socratic-agents v0.3.1 is published to PyPI for use with Socrates v2.0.0+:
pip install socratic-agents==0.3.1
This requires Socrates v2.0.0+ to be installed, as the library depends on the Socrates monolith.
Within Socrates Monolith (Development)
For development work within the Socrates monolith:
cd Socratic-agents
pip install -e .
The 19+ Agents
Core Dialogue Agents
- SocraticCounselorAgent - Guides users through Socratic questioning with full dialogue orchestration
- QuestionQueueAgent - Manages and prioritizes question queues
Project & Workflow Agents
- ProjectManagerAgent - Manages project lifecycle (creation, loading, collaboration)
- QualityControllerAgent - Orchestrates maturity tracking and quality assurance
- WorkflowOptimizationAgent - Optimizes workflow paths and decision strategies
Code & Technical Agents
- CodeGeneratorAgent - Generates code based on project context
- CodeValidationAgent - Validates and tests code
- DocumentProcessorAgent - Processes and imports project documents
- GitHubSyncHandler - Handles GitHub repository synchronization
Learning & Knowledge Agents
- UserLearningAgent - Tracks user behavior and learning patterns
- KnowledgeManagerAgent - Manages knowledge base enrichment
- KnowledgeAnalysisAgent - Analyzes and extracts knowledge insights
- ConflictDetectorAgent - Detects and resolves conflicts in specifications
User & System Agents
- UserManagerAgent - Manages user accounts and preferences
- SystemMonitorAgent - Monitors system health and token usage
- ContextAnalyzerAgent - Analyzes and manages project context
- MultiLLMAgent - Coordinates multiple LLM providers
Note & Data Agents
- NoteManagerAgent - Manages project notes and documentation
- DocumentContextAnalyzer - Analyzes semantic content of documents
Architecture
Architecture
Agents are organized by function and work together through the AgentOrchestrator:
┌─────────────────────────────────────┐
│ AgentOrchestrator │
│ ├─ Event System │
│ ├─ LLM Client (Multi-provider) │
│ └─ Message Routing (AgentBus) │
├─────────────────────────────────────┤
│ Socratic Agents (19+) │
│ ├─ Dialogue Agents │
│ ├─ Project Agents │
│ ├─ Code Agents │
│ ├─ Learning Agents │
│ └─ System Agents │
├─────────────────────────────────────┤
│ Constitutional AI Governance │
│ └─ Via socratic-morality library │
└─────────────────────────────────────┘
Key Features
- Agent Orchestration - Coordinated agent workflows through AgentOrchestrator
- Async Support - Full async/await support for non-blocking operations
- Event System - Real-time event emission for status tracking
- Database Integration - Direct access to Socrates database
- Vector DB Access - Knowledge and context retrieval
- Multi-Provider LLM - Via Socratic Nexus integration
- Type Hints - Full Python type annotations
- Comprehensive Logging - Detailed operation logging
Phase 3 Features - Constitutional AI & Governance
- GovernedAgent - Wraps agents with constitutional governance checks
- Agent Bus - Inter-agent message routing with history tracking (1000 message buffer)
- Governance Integration - Uses socratic-morality for ethical decision making
- REST API - FastAPI endpoints for governance, agents, and precedent lookup
- YAML Configuration - Constitutional governance rules and agent configuration
Quick Reference
Initialize Agents Within Socrates
from socratic_agents import AgentOrchestrator, SocraticCounselorAgent
# Create orchestrator (within Socrates context)
orchestrator = AgentOrchestrator(
database=socrates_db,
vector_db=socrates_vector_db,
claude_client=socrates_llm_client
)
# Create and use specific agent
counselor = SocraticCounselorAgent(orchestrator)
result = counselor.process({
"action": "generate_question",
"project": project_context,
"current_user": user_id
})
Available Actions Vary by Agent
Each agent has specific actions. See individual agent documentation for details.
Testing
# Install development dependencies
pip install -e ".[dev]"
# Run all tests
pytest tests/ -v --cov=src/socratic_agents
# Run with coverage report
pytest tests/ --cov=src/socratic_agents --cov-report=html
# Run specific test category
pytest -m unit
pytest -m integration
Test Coverage
Current test coverage: 81%+ across all agent implementations.
Future: Post-Architecture Redesign
After the Socrates architecture is redesigned and optimized, the following changes are planned:
- Independent Agents - Some agents will be refactored as independent packages
- Decoupled Dependencies - Reduced reliance on Socrates internals
- Modular Publishing - Agent libraries published separately to PyPI
- Standalone Mode - Core agents usable without full Socrates installation
Current independent Socratic libraries:
- socratic-analyzer - Code analysis (standalone)
- socratic-learning - Learning algorithms (standalone)
- Socratic-workflow - Workflow definitions (standalone)
- Socratic-maturity - Maturity tracking (standalone)
- And 4+ others...
Architecture Documentation
Status: Currently in integration phase within Socrates monolith.
For detailed agent documentation, see the docs/ directory (available after Socrates publication).
Contributing
This library is maintained as part of the Socrates monolith. Contributions should follow Socrates contribution guidelines.
License
MIT License - See LICENSE for details.
This library is part of the Socrates AI platform
Made by @Nireus79
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file socratic_agents-0.3.4.tar.gz.
File metadata
- Download URL: socratic_agents-0.3.4.tar.gz
- Upload date:
- Size: 112.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a1865c27fc254dd68f1ecce15700e4226092fe7c6b189c81d272df60b4f54c81
|
|
| MD5 |
54b5a709338d7448dc48d7f534b40056
|
|
| BLAKE2b-256 |
94707ef28fb6d0651e06e806cca5c3e18fd1caaaa79a885fa887d2d01251e2f3
|
File details
Details for the file socratic_agents-0.3.4-py3-none-any.whl.
File metadata
- Download URL: socratic_agents-0.3.4-py3-none-any.whl
- Upload date:
- Size: 116.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
ed3044c9541cd05123744dbe1a81b27b579065fabf551ab0db8149aae8610454
|
|
| MD5 |
02fe1b7e0d4e4771c0a0242cd1e437a7
|
|
| BLAKE2b-256 |
0cdf5bdcc7938e0e10c8479ca1e42385be6af86ea4b064e7462e31c0acd5ce12
|