Skip to content

Transparent Answers | Transparent AI. πŸ… Madhacks 2025 Finalist

Notifications You must be signed in to change notification settings

quinnhasse/LexonAI

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

74 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

Lexon AI

Transparent Answers with a 3D Evidence Graph

TypeScript React Three.js Express OpenAI Exa

Lexon AI overview thumbnail

Lexon AI is a transparent answer system that solves the "AI black box" problem. Every answer is fully verifiable through source attribution and an interactive 3D evidence graph that visualizes exactly how conclusions are reached.

Built for MadHacks 2025.

Project Links


Overview

Traditional AI systems generate answers from training data with no way to verify claims or trace reasoning. Users are left trusting a black box, unable to distinguish fact from hallucination.

Lexon AI enforces transparency through strict separation of concerns:

  • User question is received
  • Exa neural search retrieves relevant web sources
  • GPT-4o-mini generates answers using ONLY those sources (never training data)
  • Evidence graph builder constructs a 4-layer graph linking claims to sources
  • 3D visualization lets users explore the reasoning interactively

Every claim is traceable. Every source is verifiable.


AI Transparency Platform

Lexon functions as a complete AI transparency platform with three core components: a research agent (Exa), an answer agent (GPT-4o-mini constrained to sources), and an evidence graph builder that links every claim to its origin.

Lexon AI Knowledge Deck view: query, logic feed, and evidence feed

The Knowledge Deck view provides structured transparency:

  • Query Stream β€” The original question and synthesized answer blocks
  • Logic Feed β€” Reasoning chunks showing key claims with source citations
  • Evidence Feed β€” Ranked sources from Exa with relevance scores (0-100%)

Lexon AI architecture diagram: frontend, backend, and external APIs

Architecture Overview:

  • Frontend β€” Vite + React + React Three Fiber for 3D graph visualization
  • Backend β€” Node/Express API with research agent, answer agent, and graph builder
  • External APIs β€” Exa for neural search, OpenAI for constrained answer generation

Visual Simulation

The 3D evidence graph places the answer at center with concepts, sources, and supporting evidence orbiting in concentric layersβ€”like exploring a solar system of knowledge.

Lexon AI 3D cluster view of answer, concepts, and sources

Layout Modes:

  • Cluster β€” Hierarchical grouping with orbit-style paths (default)
  • Circular β€” 2D radial layout for simpler exploration
  • Globe β€” Nodes distributed on a 3D sphere surface
  • Knowledge Deck β€” Structured panel view with query/logic/evidence feeds
  • Baseline β€” Flat layer-based arrangement

Color Modes: White (clean monochrome), By Level (depth-based), By Role (node type), By Tier (layer hierarchy)

Evidence Lines, Scores, and Expansion

The connecting lines represent relationships:

  • answers β€” Question to answer, answer to blocks
  • supports β€” Blocks to sources (citations)
  • underpins β€” Sources to supporting concepts
  • semantic_related β€” Similarity-based connections

Each source displays a relevance score (0-100%) from Exa's neural search, visible in the Evidence Feed and node details.

The expand function transforms a source node into a richer concept subgraph, enabling deeper research explorationβ€”turning Lexon into a research lens, not just an answer.

Expand function: turning a source node into a richer concept subgraph


Key Features

  • Evidence-first pipeline β€” LLM restricted to retrieved sources only
  • 4-layer evidence graph β€” Question β†’ Answer β†’ Direct sources β†’ Supporting concepts
  • Multiple 3D layouts β€” Cluster, circular, globe, knowledge deck, baseline
  • Color-coded visualization β€” By level, role, tier, or clean white theme
  • Knowledge Deck view β€” Structured query/logic/evidence feeds
  • Expandable sources β€” Click to explore deeper research subgraphs
  • Real-time graph construction β€” Watch answers and graphs build dynamically
  • Smooth camera controls β€” Orbit, pan, zoom with hover/click interactions
  • Graceful degradation β€” System continues if research or generation partially fails

Quick Start

Prerequisites

Installation

# Clone the repository
git clone https://github.com/yourusername/lexon-ai.git
cd lexon-ai

# Install backend dependencies
cd backend
npm install

# Install frontend dependencies
cd ../frontend
npm install

Environment Setup

Create backend/.env:

EXA_API_KEY=your_exa_api_key_here
LLM_API_KEY=your_openai_api_key_here
PORT=3001
NODE_ENV=development

Running the Application

Terminal 1 β€” Backend:

cd backend
npm run dev
# API at http://localhost:3001

Terminal 2 β€” Frontend:

cd frontend
npm run dev
# UI at http://localhost:5173

Open http://localhost:5173 in your browser.


Usage

  1. Open the frontend at localhost:5173
  2. Enter a question in the input field (e.g., "What is AI transparency?")
  3. Wait for processing β€” Exa searches, GPT generates, graph builds (~3-8 seconds)
  4. Explore the 3D graph β€” Rotate (drag), zoom (scroll), pan (right-drag)
  5. Click nodes to view full content, sources, and metadata
  6. Switch layouts β€” Use controls to toggle cluster/circular/globe/deck views
  7. Expand sources β€” Click a source node to explore deeper subgraphs

Project Structure

lexon-ai/
β”œβ”€β”€ backend/                      # Node.js/TypeScript API server
β”‚   β”œβ”€β”€ src/
β”‚   β”‚   β”œβ”€β”€ index.ts              # Express server entry
β”‚   β”‚   β”œβ”€β”€ routes/
β”‚   β”‚   β”‚   └── answerRoute.ts    # POST /api/answer endpoint
β”‚   β”‚   β”œβ”€β”€ services/
β”‚   β”‚   β”‚   β”œβ”€β”€ researchAgent.ts  # Exa-based source retrieval
β”‚   β”‚   β”‚   β”œβ”€β”€ answerAgent.ts    # GPT-4o-mini answer generation
β”‚   β”‚   β”‚   β”œβ”€β”€ evidenceGraph.ts  # 4-layer graph construction
β”‚   β”‚   β”‚   β”œβ”€β”€ secondarySourceAgent.ts  # Layer 3 extraction
β”‚   β”‚   β”‚   └── semanticGraphBuilder.ts  # Similarity edges
β”‚   β”‚   β”œβ”€β”€ types/
β”‚   β”‚   β”‚   └── shared.ts         # TypeScript definitions
β”‚   β”‚   └── config/
β”‚   β”‚       └── config.ts         # Environment configuration
β”‚   └── scripts/                  # Test scripts
β”‚
β”œβ”€β”€ frontend/                     # React/Vite 3D visualization
β”‚   β”œβ”€β”€ src/
β”‚   β”‚   β”œβ”€β”€ App.tsx               # Main application state
β”‚   β”‚   β”œβ”€β”€ components/
β”‚   β”‚   β”‚   β”œβ”€β”€ GraphVisualization.tsx  # 3D scene orchestrator
β”‚   β”‚   β”‚   β”œβ”€β”€ KnowledgeDeck.tsx       # Structured panel view
β”‚   β”‚   β”‚   β”œβ”€β”€ Node.tsx                # Individual node rendering
β”‚   β”‚   β”‚   β”œβ”€β”€ Edge.tsx                # Connection rendering
β”‚   β”‚   β”‚   β”œβ”€β”€ NodeDetailPanel.tsx     # Node detail modal
β”‚   β”‚   β”‚   └── controls/               # Layout/color controls
β”‚   β”‚   β”œβ”€β”€ utils/
β”‚   β”‚   β”‚   β”œβ”€β”€ layoutEngine.ts   # Layout algorithms
β”‚   β”‚   β”‚   └── colorPalettes.ts  # Color mode logic
β”‚   β”‚   └── types/
β”‚   β”‚       └── index.ts          # Frontend type definitions
β”‚   └── public/
β”‚       └── examples/             # Demo data for fallback
β”‚
└── readme_assets/                # Documentation images

API Endpoints

POST /api/answer

Generate a transparent answer with evidence graph.

Request:

{
  "question": "What is AI transparency?",
  "density": "medium"
}

Parameters:

  • question (required) β€” The question to answer
  • density (optional) β€” "low" (6 sources), "medium" (9, default), "high" (12)

Response:

{
  "question": "What is AI transparency?",
  "answer": {
    "blocks": [
      { "id": "block_1", "type": "paragraph", "text": "...", "source_ids": ["src_1", "src_2"] }
    ]
  },
  "sources": [
    { "id": "src_1", "url": "https://...", "title": "...", "text": "...", "score": 0.95 }
  ],
  "evidence_graph": {
    "nodes": [...],
    "edges": [...]
  },
  "meta": { "degraded": false, "timestamp": "..." }
}

GET /health

Health check endpoint returning server status and environment.


Technologies

Frontend

  • React 18 β€” Component architecture
  • Vite β€” Fast dev server and builds
  • React Three Fiber β€” React renderer for Three.js
  • @react-three/drei β€” 3D helpers and abstractions
  • Three.js β€” WebGL 3D rendering
  • Framer Motion β€” UI animations
  • @react-spring/three β€” Physics-based node animations
  • Lucide React β€” Icon library

Backend

  • Node.js + Express β€” API server
  • TypeScript β€” Type-safe implementation
  • Exa API β€” Neural search for source retrieval
  • OpenAI GPT-4o-mini β€” Constrained answer generation
  • Custom embeddings β€” Semantic similarity for graph enhancement

Infrastructure

  • Vercel β€” Frontend deployment
  • Render β€” Backend deployment

License

MIT License β€” See LICENSE for details.


Built with transparency at MadHacks 2025

About

Transparent Answers | Transparent AI. πŸ… Madhacks 2025 Finalist

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 5

Languages