Skip to main content

Constitutional AI Agents - Reference Implementation with Governance

Project description

Socratic Agents

⚠️ SOCRATES-ONLY LIBRARY - This library is designed exclusively for use within the Socrates monolith and is NOT suitable for standalone use.


Overview

Socratic Agents is a collection of 19+ specialized agents that power the Socrates AI platform. These agents handle complex tasks like Socratic questioning, code generation, project management, quality control, learning, and conflict resolution.

Key Point: All agents in this library require the Socrates monolith to be installed locally. They depend on socratic_system internals and cannot function independently.

Requirements

  • Socrates Monolith - Must be installed locally
  • socratic_system - Must be available in Python path
  • Python 3.9+

Why Socrates-Only?

The agents in this library are tightly integrated with Socrates internals:

  • Access to centralized database
  • Vector database integration
  • Unified LLM client orchestration
  • Shared user and project context
  • Maturity tracking and workflow optimization

After the Socrates architecture redesign, many of these agents will be refactored for independence.


Installation

Within Socrates Monolith

If you're working within the Socrates monolith, Socratic-agents is already available:

cd Socrates
pip install -e Socratic-agents

As External Package (Future)

Currently, this package is NOT published to PyPI because it requires local Socrates installation.


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

Socrates-Integrated Design

All agents are designed to work within the Socrates orchestration framework:

┌─────────────────────────────────────┐
│     Socrates Monolith               │
├─────────────────────────────────────┤
│  AgentOrchestrator                  │
│  ├─ Database Connection             │
│  ├─ Vector Database                 │
│  ├─ LLM Client (Multi-provider)     │
│  └─ Event System                    │
├─────────────────────────────────────┤
│  Socratic Agents (19+)              │
│  ├─ Dialogue Agents                 │
│  ├─ Project Agents                  │
│  ├─ Code Agents                     │
│  ├─ Learning Agents                 │
│  └─ System Agents                   │
└─────────────────────────────────────┘

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

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

cd Socratic-agents

# Run all tests (requires Socrates environment)
pytest tests/ -v

# Run with coverage
pytest tests/ --cov=src/socratic_agents --cov-report=html

# Run specific test category
pytest -m unit
pytest -m integration

Future: Post-Architecture Redesign

After the Socrates architecture is redesigned and optimized, the following changes are planned:

  1. Independent Agents - Some agents will be refactored as independent packages
  2. Decoupled Dependencies - Reduced reliance on Socrates internals
  3. Modular Publishing - Agent libraries published separately to PyPI
  4. 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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

socratic_agents-0.3.1.tar.gz (110.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

socratic_agents-0.3.1-py3-none-any.whl (115.7 kB view details)

Uploaded Python 3

File details

Details for the file socratic_agents-0.3.1.tar.gz.

File metadata

  • Download URL: socratic_agents-0.3.1.tar.gz
  • Upload date:
  • Size: 110.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.15

File hashes

Hashes for socratic_agents-0.3.1.tar.gz
Algorithm Hash digest
SHA256 89106d21fc2c51a745b2ce4aa3119866f2cf4cef5e6ca2791e421bac90762140
MD5 485d59a46c2cc92045361cf4a63025d0
BLAKE2b-256 040ef433ff9da3e66a75ae50ee29934165c38aa3d0ee55a3f21d5c42b0b15ba3

See more details on using hashes here.

File details

Details for the file socratic_agents-0.3.1-py3-none-any.whl.

File metadata

File hashes

Hashes for socratic_agents-0.3.1-py3-none-any.whl
Algorithm Hash digest
SHA256 ca94f4185451f6e52336dbc770460f430a4d5697d0f8e6a85382d816dfad1925
MD5 0bd4a2581fe2025b0d83dfc13650aea8
BLAKE2b-256 ed1d5650e724449c6c24ec8abd5fb178c35b0a173bae5caf801d083f4fcf9908

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page