Skip to content

shaah1d/greymatter

 
 

Repository files navigation

GreyMatter - A debate bot for dark matter

git-banner-greymatter

GreyMatter

Dark Matter Scientific Discovery and Debate Synthesizer (Claude + RAG)

Turn dark-matter literature into living debates: retrieve, compare, and transparently argue across decades of experiments, with citations and uncertainty.

Motivation

About 85 percent of the universe is dark matter, but there is no agreement on its nature. The literature covers WIMP limits, axion haloscopes, sterile neutrinos, and null results. This RAG-powered system reads across papers, extracts claims, aligns conflicting evidence, and renders debate maps for experts and the public, with explicit uncertainty and citations.

Features

  • Multi-document semantic retrieval across papers, preprints, and educational resources
  • Consensus and contradiction mapping with support/conflict/uncertainty visualizations
  • Audience-adaptive answers: expert summary, practitioner notes, layperson analogy, embedded glossary
  • Sophisticated outputs: comparative tables, timelines, feasibility analyses
  • Uncertainty quantification with confidence scores and evidence grading
  • Single-turn, multi-facet querying producing multiple views in one shot

Repository Structure

namit24-neuralnexus_claudesolvathon/
├── README.md
├── components.json
├── eslint.config.mjs
├── next.config.ts
├── package.json
├── postcss.config.mjs
├── tsconfig.json
├── prisma/
│   └── schema.prisma
└── src/
    ├── app/
    │   ├── globals.css
    │   ├── layout.tsx
    │   ├── page.tsx
    │   ├── (auth)/
    │   │   ├── layout.tsx
    │   │   ├── sign-in/
    │   │   │   └── page.tsx
    │   │   └── sign-up/
    │   │       └── page.tsx
    │   ├── (protected)/
    │   │   ├── layout.tsx
    │   │   ├── ask/
    │   │   │   ├── layout.tsx
    │   │   │   ├── page.tsx
    │   │   │   └── _components/
    │   │   │       ├── app-sidebar.tsx
    │   │   │       ├── client-headers.tsx
    │   │   │       └── dashboard-content.tsx
    │   │   └── voice/
    │   │       └── page.tsx
    │   └── api/
    │       ├── auth/
    │       │   └── [...all]/
    │       │       └── route.ts
    │       └── bot/
    │           ├── query/
    │           │   └── route.ts
    │           ├── speak/
    │           │   └── route.ts
    │           └── synthesize/
    │               └── route.ts
    ├── components/
    │   ├── ai-elements/
    │   │   ├── actions.tsx
    │   │   ├── conversation.tsx
    │   │   ├── loader.tsx
    │   │   ├── message.tsx
    │   │   ├── prompt-input.tsx
    │   │   └── response.tsx
    │   ├── auth/
    │   │   ├── SignInForm.tsx
    │   │   └── SignUpForm.tsx
    │   ├── chat/
    │   │   ├── avatar.tsx
    │   │   ├── chatDemo.tsx
    │   │   └── dropdown-menu.tsx
    │   ├── graphs/
    │   │   ├── ConsensusGraph.tsx
    │   │   └── SynthesisPanel.tsx
    │   ├── kokonutui/
    │   │   ├── gemini.tsx
    │   │   └── profile-dropdown.tsx
    │   ├── layout/
    │   │   ├── AuthComponent.tsx
    │   │   ├── features.tsx
    │   │   ├── footer.tsx
    │   │   └── header.tsx
    │   ├── logos/
    │   │   └── logo.tsx
    │   ├── pages/
    │   │   └── hero-section.tsx
    │   ├── ui/
    │   │   ├── animated-group.tsx
    │   │   ├── animated-theme-toggler.tsx
    │   │   ├── avatar.tsx
    │   │   ├── badge.tsx
    │   │   ├── button.tsx
    │   │   ├── card.tsx
    │   │   ├── checkbox.tsx
    │   │   ├── drawer.tsx
    │   │   ├── dropdown-menu.tsx
    │   │   ├── glow.tsx
    │   │   ├── icons.tsx
    │   │   ├── If.tsx
    │   │   ├── input-group.tsx
    │   │   ├── input.tsx
    │   │   ├── label.tsx
    │   │   ├── mockup.tsx
    │   │   ├── radio-group.tsx
    │   │   ├── select.tsx
    │   │   ├── separator.tsx
    │   │   ├── sheet.tsx
    │   │   ├── sidebar.tsx
    │   │   ├── skeleton.tsx
    │   │   ├── switch.tsx
    │   │   ├── text-effect.tsx
    │   │   ├── textarea.tsx
    │   │   └── tooltip.tsx
    │   └── voice/
    │       └── voice-call-ui.tsx
    ├── contexts/
    │   └── SessionContext.tsx
    ├── hooks/
    │   └── use-mobile.ts
    ├── lib/
    │   ├── auth-client.ts
    │   ├── auth.ts
    │   ├── prisma.ts
    │   ├── prompts.ts
    │   └── utils.ts
    └── types/
        ├── react-graph-vis.d.ts
        └── synthesis.ts

Quickstart

Prerequisites

  • Node.js 18+
  • PostgreSQL database
  • Anthropic API key for Claude
  • GitHub OAuth credentials (optional, for social login)

Set environment variables:

export ANTHROPIC_API_KEY=your_key
export DATABASE_URL=postgresql://user:pass@localhost:5432/db
export GITHUB_CLIENT_ID=your_id
export GITHUB_CLIENT_SECRET=your_secret

Install

git clone https://github.com/namit24-neuralnexus_claudesolvathon.git
cd namit24-neuralnexus_claudesolvathon
npm install
npx prisma generate
npx prisma db push

Run

npm run dev

Open http://localhost:3000.

Key Features

Hybrid Retrieval

  • Dense embeddings + BM25 keyword search
  • Optional cross-encoder reranking
  • Diversified results (MMR) to avoid duplicates

Debate Synthesis

Claude-powered outputs include:

  • Expert summary with methods and caveats
  • Layperson summary with analogies
  • Glossary with precise definitions
  • Argument maps (supports/refutes/uncertain)
  • Comparative tables (candidates x evidence x constraints)
  • Timelines with citations

Uncertainty Quantification

Each claim scored on:

  • Source weight (peer-reviewed > preprint)
  • Recency (newer limits supersede hints)
  • Agreement count (independent confirmations)
  • Method quality and statistical strength

Transparent Citations

Every claim links to (author/year, page/section) with exact passage offsets.

Example Queries

  • "What do LZ 2022-2024 null results imply for spin-independent WIMP cross sections near 40-60 GeV?"
  • "Compare evidence for axions vs. sterile neutrinos; show conflicts and decisive future tests."
  • "Explain dark matter to a 12-year-old using analogies, then give an expert digest with citations."

Data Sources

Configuration

Edit .env:

EMBED_MODEL=all-MiniLM-L6-v2
HYBRID_BM25=true
TOP_K=10
RERANK=true
CLAUDE_MODEL=claude-3-5-sonnet-20241022
MAX_CONTEXT_TOKENS=200000
CITATION_STRICT=true

FAQ

Does it hallucinate?
Minimized by forcing citations, rejecting uncited claims, and showing uncertainty scores.

Can I swap embedding models?
Yes, set EMBED_MODEL and VECTOR_STORE in .env.

Does it store chat history?
No. Designed for single-turn, multi-facet responses.

License

MIT

Credits

Neural Nexus hackathon project that turns dark-matter literature into transparent, multi-audience debate maps, no training required, just smart retrieval and careful prompts.

Contributing

PRs welcome. Open an issue with:

  • What you are improving (retrieval, prompts, UI)
  • Minimal reproducible example
  • Before/after screenshots or output JSON

Acknowledgements

This project builds on the work of thousands of researchers and collaborations. Cite the original experiments and reviews when using outputs in papers or talks.

Quick Links

Resource Link
Live Demo Streamlit App
Notebook notebooks/pipeline_demo.ipynb
Documentation docs/ folder
Issues GitHub Issues
Discussions GitHub Discussions

Made for the scientific community. Illuminating the dark universe, one debate at a time.

About

GreyMatter - A S2S Debate Bot on Dark Matter

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • TypeScript 81.0%
  • Jupyter Notebook 16.9%
  • CSS 1.9%
  • JavaScript 0.2%