Transparent Answers with a 3D Evidence Graph
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.
- Demo Website: lexon-ai.vercel.app
- Devpost Project Page: devpost.com/software/lexon
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.
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.
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%)
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
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.
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)
The connecting lines represent relationships:
answersβ Question to answer, answer to blockssupportsβ Blocks to sources (citations)underpinsβ Sources to supporting conceptssemantic_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.
- 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
- Node.js 18+
- npm or pnpm
- Exa API Key β exa.ai
- OpenAI API Key β platform.openai.com
# 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 installCreate backend/.env:
EXA_API_KEY=your_exa_api_key_here
LLM_API_KEY=your_openai_api_key_here
PORT=3001
NODE_ENV=developmentTerminal 1 β Backend:
cd backend
npm run dev
# API at http://localhost:3001Terminal 2 β Frontend:
cd frontend
npm run dev
# UI at http://localhost:5173Open http://localhost:5173 in your browser.
- Open the frontend at localhost:5173
- Enter a question in the input field (e.g., "What is AI transparency?")
- Wait for processing β Exa searches, GPT generates, graph builds (~3-8 seconds)
- Explore the 3D graph β Rotate (drag), zoom (scroll), pan (right-drag)
- Click nodes to view full content, sources, and metadata
- Switch layouts β Use controls to toggle cluster/circular/globe/deck views
- Expand sources β Click a source node to explore deeper subgraphs
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
Generate a transparent answer with evidence graph.
Request:
{
"question": "What is AI transparency?",
"density": "medium"
}Parameters:
question(required) β The question to answerdensity(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": "..." }
}Health check endpoint returning server status and environment.
- 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
- 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
- Vercel β Frontend deployment
- Render β Backend deployment
MIT License β See LICENSE for details.
Built with transparency at MadHacks 2025



