Skip to content

About

Semantic search for Finnegans Wake

Resources

Stars

0 stars

Watchers

0 watching

Forks

Repository files navigation

Finnegans Bed

Semantic search for Finnegans Wake, the most incomprehensible book that people still care about.

If you're familiar with both Finnegans Wake and semantic search, you'll know that this is a horrible idea. Most words in Finnegans Wake are not pure English; it's full of portmanteaus, foreign borrowings from a hundred languages, and words that are just purely made up for their sound. Semantic search requires breaking text down into known tokens that a language model has been trained on. Finnegans Wake is full of words that likely occur inside its pages only and no where else. It some ways this is a test more of the flexibility of the semantic search model itself.

Still, in a very Wakian way it can take you from many general search terms to passages of the Wake with dreamy connections.

Requirements

  • Node.js: >= 20.9.0 (required for Next.js 16)
  • Package Manager: pnpm (recommended)

Setup

  1. Install dependencies:

    pnpm install
  2. Configure environment variables: Copy .env.example to .env.local and fill in your values:

    cp .env.example .env.local

    Required variables:

    • OPENAI_API_KEY - Your OpenAI API key
    • CHROMA_COLLECTION - Name of your Chroma collection (default: fwtext)
    • CHROMA_HOST - ChromaDB host (default: localhost)
    • CHROMA_PORT - ChromaDB port (default: 8000)
    • CHROMA_SSL - Use SSL for ChromaDB (default: false)
  3. Start Chroma & Index the text:

    pnpm chroma
    pnpm ingest
  4. Run the development server:

    pnpm dev

    Open http://localhost:3000 in your browser.

Project Structure

├── src/
│   ├── app/
│   │   ├── api/          # Next.js API routes
│   │   │   ├── fw/       # Finnegans Wake search endpoints
│   │   │   └── health/   # Health check endpoint
│   │   ├── layout.tsx    # Root layout
│   │   ├── page.tsx      # Home page
│   │   └── globals.css   # Global styles
│   ├── components/
│   │   ├── ui/           # Reusable UI components
│   │   └── FinnegansBed.tsx  # Main search interface
│   └── lib/
│       └── utils.ts      # Utility functions
├── data/
│   └── fw/               # Finnegans Wake text data files
└── public/               # Static files

API Endpoints

  • GET /api/query?q=<query> - Search Finnegans Wake
  • GET /api/text/:book/:chapter - Get chapter text

Build & Deploy

# Build for production
pnpm build

# Start chromadb
pnpm chroma

# Start production server
pnpm start

About

Semantic search for Finnegans Wake

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages