Skip to content

Jacob234/PhiloLogic

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

PhiloLogic - Redis AI Challenge Project

Real-time philosophical argument analysis platform powered by Redis 8 and Claude AI

🏆 Contest: Redis AI Challenge - Real-Time AI Innovators
Deadline: August 10, 2025
💰 Prize: $1,500 USD + DEV++ Membership + Exclusive Badge

🎯 Project Overview

PhiloLogic uses Redis 8 as the backbone for AI-powered philosophical argument analysis, providing:

  • Real-time Analysis: Instant AI feedback on argument structure and logic
  • Fallacy Detection: Identify and explain logical fallacies with confidence scores
  • Philosophical Context: Connect arguments to relevant philosophical works
  • Vector Similarity: Find semantically similar arguments using Redis vector search
  • Semantic Caching: Lightning-fast responses through intelligent caching

🚀 Quick Start

Prerequisites

  • Python 3.8+
  • Redis Cloud account (free tier) OR local Redis installation
  • Anthropic Claude API key

1. Clone and Setup

git clone <repository-url>
cd PhiloLogic

# Create virtual environment
python3 -m venv philologic-env
source philologic-env/bin/activate  # Windows: philologic-env\Scripts\activate

# Install dependencies
pip install -r requirements.txt

2. Configure Environment

# Copy environment template
cp .env.example .env

# Edit .env with your credentials:
# - REDIS_URL (Redis Cloud connection string)
# - ANTHROPIC_API_KEY (Claude API key)

3. Test Redis Connection

python test_redis.py

4. Run the Application

# Backend API
python backend/app.py

# Frontend (coming soon)
cd frontend && npm start

🔧 Redis 8 Features Implementation

1. Vector Search (RediSearch)

  • Store argument embeddings for semantic similarity matching
  • Find related arguments and philosophical positions
  • Enable "Arguments like this" feature

2. Semantic Caching

  • Cache Claude API responses using argument content hashes
  • Dramatically reduce response times for similar arguments
  • Intelligent TTL management

3. JSON Document Store (RedisJSON)

  • Store complex argument structures with nested premises
  • Rich metadata and analysis results
  • Queryable philosophical content

4. Redis Streams

  • Real-time argument processing pipeline
  • Queue management for AI analysis tasks
  • Handle concurrent analysis requests

5. Pub/Sub Messaging

  • Live notifications for analysis completion
  • Real-time collaborative features
  • Event-driven architecture

📊 Data Models

Argument Structure

{
  "id": "arg_001",
  "raw_text": "All humans are mortal. Socrates is human. Therefore, Socrates is mortal.",
  "premises": [
    {
      "text": "All humans are mortal",
      "type": "empirical_claim", 
      "confidence": 0.9
    }
  ],
  "conclusion": {
    "text": "Socrates is mortal",
    "logical_connection": "deductive"
  },
  "fallacies": [],
  "strength_score": 9.2,
  "philosophical_context": ["Aristotelian logic", "Syllogistic reasoning"]
}

🧪 Demo Scenarios

Classic Philosophy Analysis

Input: "God must exist because the universe is so complex and perfectly designed"

  • Detects: Argument from design, possible argument from ignorance
  • Context: Paley's watchmaker, Hume's critique, intelligent design debate
  • Counter-arguments: Natural selection, multiverse theory

Real-time Fallacy Detection

Input: "You can't trust John's economic policy because he's not even married"

  • Detects: Ad hominem fallacy (attacking person, not policy)
  • Confidence: 0.95
  • Educational explanation provided

🏗️ Architecture

PhiloLogic/
├── backend/              # Flask API
│   ├── models/          # Data models (Argument, Analysis)
│   ├── services/        # Redis, Claude, Vector operations
│   ├── api/            # REST endpoints
│   └── utils/          # Prompts, validation
├── frontend/           # React application
│   ├── components/     # UI components
│   ├── hooks/         # Real-time data hooks
│   └── services/      # API integration
└── test_redis.py      # Redis connection testing

🔍 API Endpoints

  • GET / - Health check and feature overview
  • POST /api/analyze - Analyze philosophical argument
  • GET /api/arguments/recent - Get recent arguments
  • GET /api/arguments/similar/:id - Find similar arguments
  • GET /api/fallacies/stats - Fallacy detection statistics

🎓 Educational Focus

PhiloLogic is designed as an educational tool to help users:

  • Understand logical argument structure
  • Identify and avoid common fallacies
  • Explore philosophical traditions and thinkers
  • Improve critical thinking skills
  • Engage with classical and contemporary philosophy

🏆 Competitive Advantages

  1. Domain Expertise: Built by philosophy graduate with deep understanding
  2. Redis Integration: Comprehensive use of all 5 Redis features
  3. Educational Value: Genuine utility beyond tech demonstration
  4. Real-time Processing: Instant feedback enhances learning
  5. Philosophical Database: Connections to actual philosophical literature

📈 Development Timeline

  • Days 1-4: Foundation (Redis setup, AI integration, architecture)
  • Days 5-11: Core development (API, features, frontend)
  • Days 12-14: Deployment, demo, submission

🤝 Contributing

This is a contest submission project, but feedback and suggestions are welcome!

📄 License

Open source as required by Redis AI Challenge


Built with ❤️ for the Redis AI Challenge by Jacob Keller
University of Pennsylvania - Philosophy & Biology

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 2

  •  
  •  

Languages