scientific-backend / README.md
Dama12's picture
docs: finalize architecture documentation and ensure exclusive K2 Think model integration
803fd56
|
Raw
History Blame
4.81 kB
metadata
title: AI Scientific Co-Investigator Backend
emoji: πŸ§ͺ
colorFrom: indigo
colorTo: blue
sdk: docker
app_port: 7860
pinned: false

πŸ§ͺ AI Scientific Co-Investigator: Deep Reasoning for Research

Detect research contradictions, generate novel hypotheses, and design rigorous protocols using deep reasoning and persistent semantic memory.

Scientific research is often hindered by the massive volume of existing literature. Researchers spend up to 60% of their time searching for contradictions, identifying gaps, and designing experiments. AI Scientific Co-Investigator automates this pipeline using the advanced K2 Think V2 Engine and sophisticated semantic orchestration.


πŸš€ Key Features

🧠 1. Long-Term Semantic Memory (New!)

  • Cross-Analysis Persistence: The agent remembers past findings, user preferences, and methodological choices across different projects.
  • Semantic Retrieval: Automatically queries past research context from Qdrant to enrich new analyses.
  • Knowledge Consolidation: Every analysis is automatically summarized and "learned" by your co-investigator.

πŸ“š 2. Multi-Source Discovery Sync

  • 200M+ Articles: Real-time integration with ArXiv, PubMed, DOAJ, and OpenAlex.
  • Unified Search: Search across all major scientific databases from a single interface.
  • Citation Intelligence: Displays citation counts and impact metrics directly in search results.

πŸ” 3. Contradiction Detection

  • Multi-Document Reasoning: Analyzes semantic meaning across multiple PDFs/Articles.
  • Conflict Identification: Flags where Paper A disagrees with Paper B on findings or metrics.
  • Resolution Paths: Suggests how to resolve scientific conflicts through new experiments.

πŸ“‹ 4. Protocol Design & Optimization

  • Step-by-Step Synthesis: Generates complete experimental protocols from scratch.
  • Resource Aware: Optimizes plans for hardware (NVIDIA GPUs), budget, and time constraints.
  • Risk Audit: Identifies safety/ethics risks and suggests mitigation strategies.

πŸ›‘οΈ 5. Ethical & Rigorous Auditing

  • Clinical Rigor: Built-in checks for clinical safety and academic integrity.
  • Reasoning Traces: Full "Chain of Thought" visibility for every AI decision.
  • Grant-Ready Exports: Export findings directly to LaTeX for grant proposals.

πŸ› οΈ Technical Architecture & Memory System

The "Co-Investigator" uses a sophisticated 3-Level Memory System to simulate a real human research partner:

  1. Level 1: Conversation Memory (PostgreSQL)
    • Persists every chat message, reasoning trace, and user interaction. Discussions are never lost on refresh.
  2. Level 2: Semantic Memory (Qdrant Vector DB)
    • Learns from every analysis. It cross-references findings between projects using vector embeddings (RAG).
  3. Level 3: Research Profile (PostgreSQL)
    • Stores your global research objectives, expertise, and constraints to tailor all AI reasoning to your specific needs.

SQL + Vector Hybrid Strategy:

  • PostgreSQL (Supabase) handles what you've done (History, Credits, Projects).
  • Qdrant (Vector DB) handles what the AI understood (Semantic Knowledge, Relationships).
graph TD
    A[Frontend: Next.js] --> B[API: FastAPI]
    B --> C[Orchestrator: K2 Think Engine]
    C --> D[Exclusive Model: K2 Think V2 API]
    D --> E[Semantic Memory: Qdrant Vector DB]
    D --> F[Relational DB: PostgreSQL / Supabase]
    C --> G[Global Discovery: OpenAlex/PubMed/ArXiv/DOAJ]
    D --> H[Export: LaTeX / CSV / PDF]

Tech Stack


βš™οΈ Deployment & Config

Environment Variables

The following secrets are required on Hugging Face Spaces:

  • DATABASE_URL: Supabase connection string.
  • SECRET_KEY: Secure random string for JWT.
  • K2_THINK_API_KEY: K2 Think V2 API key.
  • VECTOR_DB_URL & VECTOR_DB_API_KEY: Connectivity to Qdrant Cloud.
  • OPENAI_API_KEY: For semantic embeddings.
  • FRONTEND_URL: For OAuth redirect synchronization.

πŸ“„ Ownership & License

This project is the intellectual property of Soumana Dama (GitHub Profile). All rights reserved. Developed for the AI Scientific Innovation Hackathon.