Project Overview
Consilium (Arabic: مجلس) is a Next.js AI chat application that
provides a multi-model council-style AI assistant experience. The app
allows users to have conversations with an AI "council" that generates
responses based on multiple perspectives, aggregated through Gradio's
Karpathy LLM Council. Users can engage in rich conversations that
benefit from diverse AI viewpoints, with persistent storage and
automatic conversation organization.
Problem & Solution
Problem:
Users often struggle to get comprehensive answers from single AI
models, which may have blind spots or limited perspectives.
Traditional chat interfaces provide linear conversations without
capturing the nuanced decision-making process that comes from
considering multiple viewpoints.
Solution:
Consilium addresses this by implementing a "council of experts"
approach:
-
Multi-Perspective Responses - Uses Gradio's Karpathy LLM Council to
aggregate responses from multiple AI models
-
Memory-Aware Conversations - Uses Groq's LLM to maintain a
summarized memory of conversation history
-
Persistent Conversations - All conversations stored locally in
IndexedDB
-
Auto-Organization - Conversations are automatically named based on
their content
Key Features
Core AI Features
Multi-Model AI Council
Integrates with Gradio's Karpathy LLM Council to generate
responses from multiple AI models, providing diverse perspectives.
Conversation Management
Create, switch, delete, and auto-rename conversations seamlessly.
Real-time Chat Interface
Rich markdown rendering with GFM support and LaTeX math using
KaTeX.
IndexedDB Storage
Large capacity local storage for persistent conversation history.
Responsive Design
Desktop sidebar and mobile drawer layouts for all device sizes.
Bilingual Support
Full Arabic RTL support with CSS flexbox considerations.
Advanced Features
Two-Stage Memory
Groq LLM summarizes conversation history into memory (max 150
words).
URL-Based Sharing
Share conversations via URL-based conversation sharing.
Tech Stack
Next.js 16.1.7
React 19.2.3
Tailwind CSS v4
daisyUI v5.5.19
Groq SDK
Gradio Client
react-markdown
remark-gfm
remark-math
rehype-katex
IndexedDB
ESLint 9
Architecture Highlights
-
Two-stage memory approach: Groq LLM summarizes
conversation history into memory (max 150 words) for efficient
context management.
-
Multi-model response parsing: Implemented response
parsing logic in API to handle aggregated council outputs.
-
IndexedDB storage: Large storage capacity with
asynchronous operations for persistent conversations.
-
URL-based sharing: Conversation sharing through URL
parameters.
Challenges & Solutions
-
Managing Conversation Context → Two-stage memory
summarization approach using Groq LLM
-
Multi-Model Response Parsing → Implemented response
parsing logic in API to aggregate multiple model outputs
-
Browser Storage Limitations → Used IndexedDB for
large capacity storage with asynchronous operations
-
Mobile Responsiveness → daisyUI Drawer component
for mobile-friendly navigation
-
Arabic/RTL Support → CSS flexbox with RTL
considerations for bilingual support
Future Improvements
- User authentication and cloud sync
- Export conversations to PDF/Markdown
- Customizable AI council models
- Voice input/output support
- Plugin system for extensions