Skip to content

thejonathangu/Odyssey

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

53 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

Odyssey

Tartan Hacks 2026 Hackathon Project (liberal arts & creative track)

An AI-powered interactive map that extracts and visualizes geographic locations from books using Model Context Protocol. Odyssey identifies significant locations mentioned in literary texts, ranks them by narrative importance, and displays them on an interactive map for deep literary analysis.

Powered by Dedalus Labs AI and Mapbox

🌐 Live Demo: https://odyssey-wp6e.onrender.com/


Features

Two Ways to Discover Literary Locations

  1. πŸ“„ PDF Upload

    • Upload any book as a PDF (up to 200 pages extracted)
    • AI analyzes the text and extracts 3-10 real-world locations
    • Each location includes coordinates, quotes, historical context, era, and mood
  2. πŸ” Title Search

    • Search for any book by title (powered by Open Library)
    • AI recalls well-known locations from its knowledge of world literature
    • No PDF neededβ€”just search and map

Intelligent Location Ranking

  • Automatic Relevance Scoring: AI assigns each location a 1-10 relevance score based on narrative importance
  • Smart Ranking: Locations are sorted and numbered (1 = most important, N = least important)
  • Visual Markers: Each location displays its rank number directly on the map
  • Ordered Lists: Sidebar shows locations in importance order with numbered badges

Interactive Map Features

  • Multiple Map Styles: Switch between Satellite, Dark, Streets, and Light themes
  • Era Filtering: Filter locations by decade (1920s, 1940s, 1960s, etc.)
  • Year Range Slider: Fine-tune your view to specific time periods
  • Click for Details: Click any marker to see quotes, historical context, and more
  • Multi-Book Support: Upload or search multiple books to see location overlaps

MCP Architecture with Orchestration

Built on Model Context Protocol, the backend uses modular specialist agents:

  • πŸ› ArchivistAgent: Searches book databases and enriches with historical context
  • πŸ—£ LinguistAgent: Analyzes era-specific dialect and cultural references
  • 🎨 StylistAgent: Generates dynamic map styling based on book themes
  • 🎼 ConductorAgent: Orchestrates parallel agent execution and synthesizes results

Quick Demo

What you can do in 30 seconds:

  1. πŸ“– Search "On the Road" by Jack Kerouac
  2. πŸ€– Watch AI extract iconic locations across America
  3. πŸ—ΊοΈ See numbered markers (1-6) showing journey importance
  4. πŸ“ Click a marker to read quotes and historical context
  5. 🎨 Switch map styles to match the book's vibe

Or upload your own PDF book and discover its geography!


MCP Architecture & Workflows

Architecture Overview

image

Odyssey uses Model Context Protocol to coordinate multiple AI agents working together. Instead of a single monolithic prompt, specialized agents handle specific tasks and coordinate through a central conductor.

β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚  Frontend (React + Mapbox GL JS)                                β”‚
β”‚  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”‚
β”‚  β”‚ Book Upload  β”‚  β”‚ Title Search β”‚  β”‚ Interactive Map        β”‚ β”‚
β”‚  β”‚ (PDF)        β”‚  β”‚ (Open Lib)   β”‚  β”‚ (Ranked Markers)       β”‚ β”‚
β”‚  β””β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”˜  β””β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”˜  β””β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β”‚
β”‚         β”‚                 β”‚                   β”‚                 β”‚
β”‚         β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”˜                 β”‚
β”‚                   β–Ό                      β–Ό                      β”‚
β”‚         POST /upload-pdf         POST /extract-from-title       β”‚
β”‚         POST /orchestrate        POST /chat-about-place         β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                    β”‚                      β”‚
                    β–Ό                      β–Ό
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚  Django Backend (MCP Server)                                    β”‚
β”‚                                                                 β”‚
β”‚  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”‚
β”‚  β”‚  PDF Processor / Title Extractor                           β”‚ β”‚
β”‚  β”‚  β€’ Extracts text from PDFs (PyMuPDF)                       β”‚ β”‚
β”‚  β”‚  β€’ Calls Dedalus AI to identify locations                  β”‚ β”‚
β”‚  β”‚  β€’ Ranks locations by relevance (1-10 scoring)             β”‚ β”‚
β”‚  β”‚  β€’ Sorts and assigns rank numbers (1 = most important)     β”‚ β”‚
β”‚  β”‚  β€’ Returns GeoJSON FeatureCollection                       β”‚ β”‚
β”‚  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β”‚
β”‚                                                                 β”‚
β”‚  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”‚
β”‚  β”‚  ConductorAgent (Orchestration)                            β”‚ β”‚
β”‚  β”‚  β€’ Receives user queries about locations                   β”‚ β”‚
β”‚  β”‚  β€’ Delegates to specialist agents in parallel              β”‚ β”‚
β”‚  β”‚  β€’ Synthesizes responses into unified narrative            β”‚ β”‚
β”‚  β”‚                                                            β”‚ β”‚
β”‚  β”‚  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”      β”‚ β”‚
β”‚  β”‚  β”‚ πŸ› Archivist β”‚  β”‚ πŸ—£ Linguist  β”‚  β”‚ 🎨 Stylist   β”‚      β”‚ β”‚
β”‚  β”‚  β”‚ Historical   β”‚  β”‚ Dialect      β”‚  β”‚ Map Theme    β”‚      β”‚ β”‚
β”‚  β”‚  β”‚ Context      β”‚  β”‚ Analysis     β”‚  β”‚ Generation   β”‚      β”‚ β”‚
β”‚  β”‚  β””β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”˜  β””β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”˜  β””β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”˜      β”‚ β”‚
β”‚  β”‚         β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”˜              β”‚ β”‚
β”‚  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β”‚
β”‚                         β–Ό                     β–Ό                 β”‚
β”‚                  Dedalus Labs API (GPT-4o)                      β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

Workflow 1: Book Location Extraction

User uploads PDF or searches by title β†’ Text Analysis β†’ AI Location Extraction β†’ Ranking & Sorting β†’ Map Display

  1. Input: User uploads a PDF book or enters a title
  2. Text Extraction:
    • PDF: Extract up to 200 pages of text using PyMuPDF
    • Title: Use book metadata (title, author, year)
  3. AI Extraction: Call Dedalus AI with specialized prompt:
    "You are an expert literary geographer. Extract 3-10 real-world
    locations from this book, with coordinates, quotes, historical
    context, and a relevance score (1-10) for each location."
    
  4. Ranking: Sort locations by relevance score, assign ranks (1-N)
  5. GeoJSON Generation: Convert to GeoJSON FeatureCollection with properties:
    • rank: 1 = most important, N = least important
    • relevance: Original AI score (1-10)
    • title, coordinates, quote, historical_context, era, mood
  6. Map Display: Render numbered markers on map, sorted list in sidebar

Workflow 2: MCP Agent Orchestration

User clicks location β†’ Conductor Reasoning β†’ Parallel Agent Execution β†’ Synthesis β†’ Rich Narrative

  1. User Action: User clicks a map marker or selects an era
  2. POST /orchestrate: Frontend sends request to ConductorAgent
  3. Conductor Reasoning: Determines which agents are needed:
    • ArchivistAgent for historical facts
    • LinguistAgent for dialect analysis
    • StylistAgent for visual theming
  4. Parallel Execution: All agents run simultaneously via ThreadPoolExecutor
  5. AI Enrichment: Each agent calls Dedalus AI with specialized prompts
  6. Synthesis: Conductor generates unified narrative combining all results
  7. Timeline: Returns delegation timeline showing each agent's latency
  8. UI Update: Display enriched information with orchestration visualization

Key MCP Benefits

βœ… Modular Specialization: Each agent has one focused responsibility
βœ… Parallel Execution: Agents run concurrently, not sequentially
βœ… Observable Orchestration: See exactly which agents were called and how long each took
βœ… Composable Intelligence: Conductor combines multiple AI perspectives
βœ… Scalable Architecture: Easy to add new specialist agents


Getting Started

Option 1: Use the Deployed App (Recommended)

🌐 Live Demo: https://odyssey-wp6e.onrender.com/

Just click the link and start exploring! No installation required.


Option 2: Run Locally

If you want to run Odyssey on your own machine or contribute to development:

Prerequisites

  • Python 3.11+
  • Node.js 18+
  • Dedalus Labs API key (get one here)
  • Mapbox access token (get one here)
  • Google Maps API key (optional, for Street View)

Installation & Setup

1. Clone the repository

git clone <your-repo-url>
cd odyssey

2. Set up environment variables

Create a .env file in the root directory:

# Dedalus Labs API key (required for AI location extraction)
DEDALUS_API_KEY=dsk-live-your-key-here

# Mapbox access token (required for maps)
VITE_MAPBOX_ACCESS_TOKEN=pk.eyJ1...your-token-here

# MCP server URL (use localhost for local development)
VITE_MCP_BASE_URL=http://localhost:8000

# Google Maps API key (optional, for Street View images)
VITE_GOOGLE_API_KEY=your-key-here

3. Start the backend (Django MCP Server)

# Navigate to backend
cd mcp-servers

# Create virtual environment (recommended)
python3 -m venv venv
source venv/bin/activate  # On Windows: venv\Scripts\activate

# Install dependencies
pip install -r requirements.txt

# Start Django server
python manage.py runserver 0.0.0.0:8000

Backend will be running at http://localhost:8000

4. Start the frontend (React + Vite)

Open a new terminal:

# Navigate to frontend
cd frontend

# Install dependencies
npm install

# Start development server
npm run dev

Frontend will be running at http://localhost:3000

5. Open in your browser

Navigate to http://localhost:3000 and start exploring!


πŸ›  Tech Stack

Layer Technology Purpose
Frontend React 18 + Vite 5 Modern, fast web framework
Mapping Mapbox GL JS 3.3 Interactive map rendering
Map Styles Mapbox (Satellite, Dark, Streets, Light) Multiple visual themes
PDF Processing PyMuPDF (fitz) Text extraction from PDFs
Backend Django 5.1 (Python) RESTful API server
AI Provider Dedalus Labs (GPT-4o) Location extraction & enrichment
Protocol Model Context Protocol (MCP) Agent orchestration framework
Book Search Open Library API Book metadata and search
Street View Google Static Street View API Location imagery
Orchestration Python ThreadPoolExecutor Parallel agent execution
Data Format GeoJSON Geographic data interchange

How It Works

Location Extraction Process

  1. Text Input: Book text is either extracted from PDF or retrieved from AI's knowledge
  2. AI Prompt: A specialized prompt asks the AI to act as a "literary geographer"
  3. Extraction Criteria:
    • 3-10 locations maximum
    • Real-world places with accurate coordinates
    • Relevance score (1-10) based on narrative importance:
      • 10: Central to plot, major scene location
      • 7-9: Significant location, important events
      • 4-6: Supporting location, mentioned multiple times
      • 1-3: Minor mention, background detail
  4. Ranking: Locations sorted by relevance, assigned ranks (1 = most important)
  5. GeoJSON Output: Structured data with coordinates, quotes, context, and metadata

Relevance vs. Rank

  • Relevance Score (1-10): AI's assessment of narrative importance
  • Rank (1-N): Sequential ordering after sorting by relevance
    • Rank 1 = Highest relevance score (most important location)
    • Rank N = Lowest relevance score (least important location)

Example

If a book has 6 locations with relevance scores: [9, 8, 7, 5, 4, 2]

Location Relevance Rank Display
Paris apartment 9 1 β‘  on map
CafΓ© de Flore 8 2 β‘‘ on map
Luxembourg Gardens 7 3 β‘’ on map
Notre-Dame 5 4 β‘£ on map
Train station 4 5 β‘€ on map
Hotel lobby 2 6 β‘₯ on map

Use Cases

  • πŸ“– Literary Analysis: Study the geographic scope of novels and travel narratives
  • ✈️ Literary Tourism: Plan trips based on locations from your favorite books
  • πŸŽ“ Education: Visualize historical events and settings in literature
  • πŸ“ Book Clubs: Explore locations discussed in book club selections
  • πŸ—ΊοΈ Comparative Literature: Compare geographic settings across multiple books
  • πŸ” Research: Analyze patterns in literary geography by era or author

Contributing

This project was built for TartanHacks 2026. Contributions, issues, and feature requests are welcome!

Future Enhancements

  • Support for more book formats (EPUB, MOBI)
  • Export location lists to Google Maps or Apple Maps
  • User accounts and saved book collections
  • Social features (share discoveries, collaborative annotations)
  • Author/series exploration mode
  • Enhanced visualizations (heatmaps, journey paths)
  • Mobile app version

Built for TartanHacks 2026

For questions, feedback, or demo requests, please reach out!


Map the stories. Explore the world. One book at a time. πŸ—ΊοΈπŸ“š

About

πŸ₯ˆ 2nd Place at TartanHacks 2026, Creative Arts Track πŸ₯ˆ- A MCP-Powered Literary Map

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors