A terminal-based multi-AI consultation room where specialized AI assistants discuss problems from their expert perspectives, helping you make informed decisions through real-time AI-to-AI debates.
- Personality: Conservative, risk-focused, meticulous
- Expertise: Contract law, employment law, IP, compliance, litigation
- Style: "This carries significant legal risk. Have we considered the regulatory implications?"
- Knowledge: RAG-powered with actual legal documents and statutes
- Personality: Solution-oriented, pragmatic, sometimes impatient with constraints
- Expertise: Software architecture, APIs, databases, security, DevOps
- Style: "@Legal-AI, you're being overly cautious. This is standard industry practice."
- Philosophy: Move fast, build efficiently, technical elegance
- Personality: Strategic, diplomatic, results-driven mediator
- Expertise: ROI analysis, market strategy, stakeholder management, risk-benefit analysis
- Style: "Let's find a middle ground that manages risk while staying competitive."
- Focus: Balance legal caution with technical ambition
- AIs respond to each other, not just you
- Natural disagreements and professional debates
- Direct challenges: "@Tech-AI, you're overlooking the compliance requirements..."
- Collaborative problem-solving in real-time
- Manipulation-resistant - won't help with unethical requests regardless of framing
- Consistent refusals with alternative suggestions
- Built-in legal/ethical guardrails that can't be bypassed
- RAG System fed with actual legal documents
- Not just "pretending" to be experts - has domain-specific knowledge
- Searchable legal knowledge that informs responses
- Ollama for local AI models (no API costs)
- Local knowledge base with your documents
- Python terminal interface - no web dependencies
- Complete privacy - everything runs on your machine
# Clone or download the project files
cd Multiple\ Experts
# Run the setup script
python setup_multi_ai.pyThe setup script will:
- Install required Python packages
- Guide you through Ollama installation
- Download AI models (llama2)
- Set up the legal documents directory
# Add your PDF legal documents to the legal_docs folder
# The system will automatically process them for Legal-AIpython multi_ai_consultation.py
# OR use the convenient launcher
python launch_consultation.pyπ€ You: I want to scrape competitor pricing data from their website
π Consulting with AI experts...
βοΈ Legal-AI: I must advise extreme caution here. Website scraping often violates
Terms of Service agreements, and could expose you to legal action under the
Computer Fraud and Abuse Act. We need to review their robots.txt and ToS first.
π» Tech-AI: Technically, this is straightforward with tools like Scrapy or
Beautiful Soup. @Legal-AI, while ToS violations are a concern, enforcement
is rare for basic price monitoring. The technical implementation is simple.
βοΈ Legal-AI (follow-up): @Tech-AI, you're underestimating the risk. The hiQ vs
LinkedIn case established that ToS violations can constitute unauthorized
access. I recommend using public APIs or manually collecting publicly
available data instead.
π Business-AI: Both perspectives have merit. @Legal-AI raises valid compliance
concerns, but @Tech-AI is right about competitive necessity. What if we start
with publicly available pricing pages and manual collection, then explore
API partnerships with data providers?
graph TB
subgraph "User Interface"
User["π€ User"]
Terminal["π₯οΈ Terminal Interface"]
User --> Terminal
end
subgraph "Multi-AI Core System"
System["π― MultiAIConsultation"]
PromptMgr["π PromptManager"]
Ethics["π‘οΈ Ethical Boundaries"]
Session["πΎ Session Logger"]
Terminal --> System
System --> PromptMgr
System --> Ethics
System --> Session
end
subgraph "AI Expert Panel"
Legal["βοΈ Legal-AI<br/>Conservative & Risk-Focused"]
Tech["π» Tech-AI<br/>Solution-Oriented & Pragmatic"]
Business["π Business-AI<br/>Strategic & Diplomatic"]
System --> Legal
System --> Tech
System --> Business
Legal -.->|"@Tech-AI challenges"| Tech
Tech -.->|"@Legal-AI pushback"| Legal
Business -.->|"Mediates conflicts"| Legal
Business -.->|"Finds balance"| Tech
end
subgraph "Knowledge Systems"
RAG["π Legal RAG System"]
PDFProc["π PDF Processor"]
Docs["π Legal Documents"]
Chunks["π§© Document Chunks"]
Embeddings["π Vector Embeddings"]
Legal --> RAG
RAG --> Chunks
PDFProc --> Chunks
Docs --> PDFProc
Chunks --> Embeddings
end
subgraph "AI Infrastructure"
Ollama["π€ Ollama Local Models"]
MockAI["π Mock AI (Dev Mode)"]
Models["π¦ llama2, codellama"]
Legal --> Ollama
Tech --> Ollama
Business --> Ollama
Ollama --> Models
Legal -.->|"Fallback"| MockAI
Tech -.->|"Fallback"| MockAI
Business -.->|"Fallback"| MockAI
end
Multiple Experts/
βββ multi_ai_consultation.py # Main consultation system
βββ specialized_legal_prompts.py # AI personality definitions
βββ legal_rag_system.py # Knowledge base integration
βββ enhanced_pdf_processor.py # PDF document processing
βββ setup_multi_ai.py # Installation script
βββ launch_consultation.py # Convenient launcher
βββ legal_docs/ # Your legal documents (PDFs)
βββ processed_legal_docs/ # Processed document chunks
Get legal, technical, and business perspectives simultaneously on new initiatives.
Multi-angle analysis of business decisions with built-in risk evaluation.
Built-in conscience that won't compromise on ethics, always suggesting legal alternatives.
Watch experts debate and learn from different professional viewpoints.
Automatically logged sessions create audit trails of decision-making processes.
- Automatic OCR for scanned documents
- Intelligent legal document chunking
- Metadata extraction (citations, case names, dates)
- Support for multiple PDF libraries
- Domain-specific expertise for each AI
- Context-aware responses
- Professional debate patterns
- Ethical boundary enforcement
- Automatic conversation logging
- JSON export for analysis
- Searchable conversation history
- Session replay capabilities
- Python 3.8+
- Ollama (for AI models)
- 8GB+ RAM (for AI models)
- PyPDF2 / PyMuPDF
- Tesseract OCR
- PIL/Pillow
- llama2: Primary model for all AIs
- llama2:13b: Optional larger model for complex legal analysis
- codellama: Optional specialized model for Tech-AI
The system includes unbreakable ethical safeguards:
- No illegal activity assistance - regardless of how requests are framed
- Automatic alternative suggestions - redirects to legal approaches
- Professional ethics maintenance - even when AIs disagree
- Transparent refusals - clear explanations of why something can't be done
Extend the system by modifying specialized_legal_prompts.py:
class NewAIPrompts:
SYSTEM_PROMPT = """Your new AI personality..."""
# Add specialized promptsIntegrate domain-specific documents:
- Add documents to appropriate folder
- Run the PDF processor
- Integrate with your AI persona
Adjust AI behavior in multi_ai_consultation.py:
- Temperature settings
- Response patterns
- Debate triggers
Ollama not found:
# Install Ollama first
curl -fsSL https://ollama.ai/install.sh | sh
ollama pull llama2PDF processing fails:
pip install PyPDF2 PyMuPDF Pillow pytesseractMemory issues:
- Use smaller models (llama2:7b instead of llama2:13b)
- Close other applications
- Consider cloud deployment
- Use SSD storage for better model loading
- Install models locally:
ollama pull llama2 - Process PDFs in batches for large document sets
- Web interface for easier access
- Voice interaction capabilities
- Integration with external legal databases
- Custom AI persona creation wizard
- Multi-language support
- Cloud deployment options
This project is open source. Use it freely for personal and commercial purposes.
- Built on top of Ollama for local AI inference
- Uses Sentence Transformers for document embeddings
- Inspired by the need for multi-perspective decision making
python setup_multi_ai.pyWelcome to your personal board of AI advisors! π―