OpenClaw framework integration for Socrates AI - Socratic method discovery skill
Project description
Socratic OpenClaw Skill - Modern Architecture
Socratic method discovery skill for OpenClaw using modern modular architecture
This is the modernized replacement for the deprecated socrates-ai-openclaw package. It uses the latest socratic-core library instead of the monolithic socrates-ai package.
Features
๐ Socratic Discovery - Claude-guided questioning for project discovery ๐ RAG Knowledge Base - Vector embeddings with ChromaDB for context-aware responses ๐ Specification Generation - Auto-generate requirements, architecture, and project specs ๐พ Session Persistence - Resume discoveries anytime ๐ Multi-turn Conversations - Natural dialogue flow with context tracking โก Production Ready - Built on battle-tested socratic-core library
Installation
pip install socratic-openclaw-skill
Quick Start
from socratic_openclaw_skill import SocraticDiscoverySkill
# Initialize the skill
skill = SocraticDiscoverySkill()
# Start a discovery session
result = await skill.start_discovery("AI-powered SaaS application")
print(result["question"])
# Output: "What problem does this solve for your target users?"
# Respond to the question
result = await skill.respond(result["session_id"], "Helps teams manage projects efficiently")
print(result["question"])
# Generate a specification
result = await skill.generate(result["session_id"])
print(result["spec"])
With OpenClaw
# Install OpenClaw
pip install openclaw
# Socratic discovery is automatically available
# Users can start a discovery session in their preferred channel
In OpenClaw chat:
User: "Help me plan a new project"
OpenClaw: "I'll guide you through Socratic discovery. Question 1: What problem does this solve?"
User: "Tracks team time efficiently"
OpenClaw: "Question 2: Who are your target users?"
... (continues for 5-8 turns)
User: "Generate a spec"
OpenClaw: "Here's your project specification..."
Architecture
User Input (OpenClaw)
โ
SocraticDiscoverySkill (Modern)
โ
โโ SessionManager (track sessions)
โโ QuestionEngine (generate questions)
โโ ResponseProcessor (handle answers)
โโ SpecGenerator (create specs)
โโ StorageHandler (persist data)
โ
socratic-core Library (Foundation)
โ
โโ SocratesConfig
โโ EventEmitter
โโ Exception hierarchy
โโ Logging infrastructure
โ
Claude API (LLM)
ChromaDB (RAG)
Configuration
Environment Variables
# Required
export ANTHROPIC_API_KEY="sk-ant-..."
# Optional
export SOCRATIC_MODEL="claude-opus-4-5"
export SOCRATIC_TEMPERATURE="0.7"
export SOCRATIC_WORKSPACE_ROOT="~/.openclaw/workspace"
Programmatic Configuration
from socratic_openclaw_skill import SocraticDiscoverySkill
from pathlib import Path
skill = SocraticDiscoverySkill(
workspace_root=Path.home() / ".openclaw" / "workspace",
model="claude-opus-4-5",
temperature=0.7
)
API Reference
SocraticDiscoverySkill
start_discovery(topic: str) -> Dict
Start a new Socratic discovery session.
Parameters:
topic(str): The project or concept to discover
Returns:
{
"status": "started",
"session_id": "discover_1234567890_abc",
"topic": "AI-powered expense tracker",
"question": "What problem does this solve?",
"progress": {"step": 1}
}
respond(session_id: str, response: str) -> Dict
Record user response and get next question.
Parameters:
session_id(str): Session ID from start_discoveryresponse(str): User's response to previous question
Returns:
{
"status": "question_asked",
"session_id": "discover_...",
"question": "Who is your target user?",
"progress": {"questions_asked": 2, "responses_recorded": 1}
}
generate(session_id: str) -> Dict
Generate project specification from discovery.
Parameters:
session_id(str): Session ID from start_discovery
Returns:
{
"status": "spec_generated",
"session_id": "discover_...",
"spec": "# Project Name\n\n## Overview\n...",
"saved_to": "~/.openclaw/workspace/projects/project-name/PROJECT.md",
"artifacts": ["PROJECT.md", "REQUIREMENTS.md", "ARCHITECTURE.md"]
}
Migration from socrates-ai-openclaw
The old socrates-ai-openclaw package is deprecated and broken. Use this package instead:
Before (Broken):
# โ BROKEN - depends on non-existent socrates-ai>=1.3.0
pip install socrates-ai-openclaw
Now (Works):
# โ
WORKS - uses modern modular architecture
pip install socratic-openclaw-skill
Code Changes
# Old (broken)
from socrates_openclaw import SocraticDiscoverySkill
# New (works)
from socratic_openclaw_skill import SocraticDiscoverySkill
Storage
Projects are stored in your workspace directory:
~/.openclaw/workspace/
โโโ projects/
โ โโโ project-name-1/
โ โ โโโ PROJECT.md
โ โ โโโ REQUIREMENTS.md
โ โ โโโ ARCHITECTURE.md
โ โ โโโ .session-*.json
โ โโโ project-name-2/
โโโ .socrates-vectors/ (ChromaDB embeddings)
โโโ .socrates-kb/ (Knowledge base)
โโโ .socratic-sessions.json (Session tracking)
All data is stored locally - no cloud upload.
Troubleshooting
API Key Issues
# Error: Anthropic key not found
# Solution:
export ANTHROPIC_API_KEY="sk-ant-..."
# Or in code:
import os
os.environ["ANTHROPIC_API_KEY"] = "your-key"
Missing Dependencies
# If you get import errors:
pip install socratic-openclaw-skill[dev]
Contributing
Contributions are welcome! Please:
- Fork the repository
- Create a feature branch
- Write tests
- Submit a pull request
See CONTRIBUTING.md for details.
Support
- GitHub Issues: Report bugs
- Documentation: Full docs
- Email: support@socrates-ai.dev
License
MIT License - see LICENSE file
Acknowledgments
Built with:
- socratic-core - Foundation library
- Anthropic Claude - LLM
- ChromaDB - Vector storage
- OpenClaw - AI assistant platform
Made with โค๏ธ for the Socrates and OpenClaw communities
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 Distributions
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 socrates_ai_openclaw-0.1.0-py3-none-any.whl.
File metadata
- Download URL: socrates_ai_openclaw-0.1.0-py3-none-any.whl
- Upload date:
- Size: 9.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 |
2def3adfe307ac73087451f35752b9309aaa302a13cfde5dc1d90fb6d66818df
|
|
| MD5 |
4a7ca59d4e245acb227c1f3912ca456f
|
|
| BLAKE2b-256 |
be467fc2a0c46a0f63c77d737549f54075a2ae5e95d23ccb49ccb437df407da2
|