"A new way of exploring space biology."
BioKnowdes is an integrated platform designed to help researchers, students, and decision-makers navigate, understand, and uncover connections within NASAβs vast collection of life sciences research. By combining Knowledge Graphs, Heatmaps, and Generative AI, we transform unstructured PDFs into a dynamic universe of data.
π₯ Watch the Demo Video
BioKnowdes bridges the gap between complex scientific research and accessible knowledge. The platform ingests 600+ open-access Space Biology publications and allows users to discover patterns that might otherwise remain buried in massive amounts of textual data.
The core of BioKnowdes. It represents research papers as nodes and shared concepts as connections.
- Pipeline: PDF Text Extraction (Apache Tika) β Keyword Extraction (KeyBERT/SciBERT) β Graph Construction (NetworkX).
- Goal: Visualize how studies relate to one another and identify emerging trends.
A high-level view that measures the similarity between top research articles.
- Visual: Interactive grid highlighting clusters of related work.
- Utility: Detect gaps in scientific knowledge and understand research concentrations.
Lumi is a conversational agent powered by a RAG (Retrieval-Augmented Generation) system.
- Retrieve: Searches the database for relevant papers using semantic ranking.
- Augment: Uses key content from selected papers as context.
- Generate: Produces clear answers cited directly from NASA sources.
- Tech Note: While designed to work with local models (Llama 3.1 via Ollama), the production version utilizes the OpenAI API for performance and stability.
-
Backend: Python, Flask
-
Data Processing: Apache Tika (text extraction), Pandas, NetworkX
-
AI & NLP:
- LangChain (RAG Workflow)
- OpenAI API (Production LLM) / Ollama (Local Dev)
- Sentence-Transformers, KeyBERT, SciBERT
-
Frontend: HTML, CSS, JavaScript, Pyvis Network (Graph), Plotly (Heatmap)
- Python 3.9+
- Virtual Environment (recommended)
-
Clone and install dependencies:
git clone https://github.com/your-username/bioknow-nasa.git cd bioknow-nasa python -m venv venv source venv/bin/activate # Windows: venv\Scripts\activate pip install -r requirements.txt
-
Configure Environment Variables: Copy the template and edit with your keys.
cp env.template .env
Required variables in
.env:# OpenAI API (Mandatory for Lumi Agent) OPENAI_API_KEY=sk-your-openai-key-here # Flask Security FLASK_SECRET_KEY=your-secret-key-here # Optional (for future multi-model support) ANTHROPIC_API_KEY=... GEMINI_API_KEY=...
python app.pyAccess the application at: http://localhost:5000/
-
Copy the environment variable template:
cp env.template .env
-
Set your API keys in the file
.env:# Edit the .env file with your real keys nano .env -
Mandatory variables for production:
# OpenAI API (mandatory for full functionality) OPENAI_API_KEY=sk-your-openai-key-here # Flask secret key (mandatory for sessions) FLASK_SECRET_KEY=your-secret-key-here # Other APIs (Optional) ANTHROPIC_API_KEY=your-anthropic-key-here GEMINI_API_KEY=your-gemini-key-here
- β
Never commit the file
.env(its already on.gitignore) - β Use different keys for development and production
- β Rotate your keys periodically
- β Set environment variables on your hosting provider
For platforms such as Heroku, Railway, or Vercel:
#Configure the environment variables on the provider panel
OPENAI_API_KEY=sk-your-production-key
FLASK_SECRET_KEY=your-production-secret-key
FLASK_ENV=productionAll of the BioKnowdes routes are now under the prefix /ask-lumi:
| Old Route | New Route | Description |
|---|---|---|
/chat |
/ask-lumi |
Main chat page |
/articles |
/ask-lumi/articles |
Article browser |
/settings |
/ask-lumi/settings |
AI settings |
/upload |
/ask-lumi/upload |
Document upload |
/documents |
/ask-lumi/documents |
List documents |
/documents/toggle/:id |
/ask-lumi/documents/toggle/:id |
Toggle selection |
/documents/delete/:id |
/ask-lumi/documents/delete/:id |
Delete document |
/clear |
/ask-lumi/clear |
Clear session |
/external-demo |
/ask-lumi/external-demo |
External example |
| Old Route | New Route | Method | Description |
|---|---|---|---|
/chat (POST) |
/ask-lumi/chat |
POST | AI Chat |
/api/load-articles |
/ask-lumi/api/load-articles |
POST | Load articles |
/api/articles-list |
/ask-lumi/api/articles-list |
GET | List articles |
/api/search-articles |
/ask-lumi/api/search-articles |
POST | Search articles |
/api/settings |
/ask-lumi/api/settings |
GET/POST | AI Config |
These are the original project routes that were not changed:
/- Home with graph/graph- Graph search/heatmap- Thermal analysis/get_graph_data- Graph data/api/keywords- Keywords list
- β
app.py- All of the BioKnowdes routes altered - β
CORS updated to
/ask-lumi/api/*
- β
templates/index.html- Menu links - β
templates/chat.html- Navigation links - β
templates/articles.html- Link "Back to Chat" - β
templates/settings.html- Link "Back to Chat"
- β
static/js/bioknowdes.js- All fetch calls - β
static/js/articles.js- API calls and redirections - β
static/js/settings.js- API calls and redirections
- β
external_button_example.html- API URL and redirect
Home (Graph): http://localhost:5000/
AI Chat: http://localhost:5000/ask-lumi
Browse Articles: http://localhost:5000/ask-lumi/articles
Settings: http://localhost:5000/ask-lumi/settings
Heatmap: http://localhost:5000/heatmap
# AI Chat
POST http://localhost:5000/ask-lumi/chat
{
"message": "Your question here"
}
# Load articles
POST http://localhost:5000/ask-lumi/api/load-articles
{
"filenames": ["article1_text.txt", "article2_text.txt"]
}
# List all articles
GET http://localhost:5000/ask-lumi/api/articles-list
# Settings
GET http://localhost:5000/ask-lumi/api/settings
POST http://localhost:5000/ask-lumi/api/settings
{
"provider": "openai",
"openai": {
"api_key": "...",
"model": "gpt-4"
}
}Execute the server:
cd /home/jabs/development/personal/Nasa-Space-Apps_25/bioknow-nasa
source venv/bin/activate
python app.pyTest each route:
# Original home
curl http://localhost:5000/
# Chat (must return HTML)
curl http://localhost:5000/ask-lumi
# Articles API
curl http://localhost:5000/ask-lumi/api/articles-listβββββββββββββββ
β Home β (Graph - /)
β (Graph) β
ββββββββ¬βββββββ
β
βββββββββββββββ
β β
ββββββββΌβββββββ ββββΌβββββββββ
β Heatmap β β Ask-Lumi β (/ask-lumi)
β (/heatmap) β β (Chat) β
βββββββββββββββ βββββββ¬ββββββ
β
ββββββββββββββ¬βββββββββββββββ
β β β
ββββββββΌβββββββ ββββΌβββββββββ ββββΌββββββββββ
β Articles β β Settings β β External β
β (/articles)β β(/settings)β β Demo β
βββββββββββββββ βββββββββββββ ββββββββββββββ
-
User acess home (
/)- Sees graph visualization
- Dropdown menu with all options
-
Clicks "AI Chat" β Goes to
/ask-lumi- Can load documents
- Can go to
/ask-lumi/articlesor/ask-lumi/settings
-
Loads articles on
/ask-lumi/articles- Selects articles
- Clicks "Load Selected"
- API:
POST /ask-lumi/api/load-articles - Redirects to
/ask-lumiwith session_id
-
Asks questions on the chat
- API:
POST /ask-lumi/chat - AI answers based on documents
- API:
β
Organization: All BioKnowdes routes grouped under /ask-lumi
β Separation: Clear distinction between:
- Graph visualization (original)
- AI and document analysis (BioKnowdes)
β
Scalability: Each to add new features under /ask-lumi
β
External API: CORS configured to /ask-lumi/api/*
-
Session ID: Always included in API responses
-
CORS: Allowed only for
/ask-lumi/api/*, for security -
Navigation: All templates have updated links
-
redirects: After loading articles or saving settings, redirects to
/ask-lumi
# Verify if its accessing with the correct prefix
# WRONG: /articles
# CORRECT: /ask-lumi/articles# Make sure its requisition goes to /ask-lumi/api/*
# CORS is configured only for this prefix# Verify if the session_id is being passed correctly
# On the URL after loading articlesFull Update! π
All routes are now organized under /ask-lumi.