A Java desktop tool that captures a region of the screen, extracts the text with Tesseract and sends it to an OpenAI model with your instructions.
Neolithic runs in the background and listens for a global hotkey. When triggered, you drag a box around any text on screen (a worksheet, a PDF, a web page), proofread the OCR result, type an instruction such as "explain this" or "solve this math problem", and get the answer in a chat window. It was written to help students with learning disabilities work with text they find hard to read.
- Global hotkey (
Ctrl+Shift) that works from any application - Click-and-drag area selection with a live preview
- OCR with Tess4J, using the bundled English model in
tessdata/ - Text cleanup with LanguageTool spelling and grammar correction
- Editable OCR result and instruction box before anything is sent
- Chat window for follow-up questions, using
gpt-4-turbo-preview
- JDK 21
- Maven
- An OpenAI API key
- A desktop session (the app uses Swing and a native keyboard hook)
mvn clean package -DskipTestsThis is the same command CI runs. mvn test runs the unit tests in src/test.
The API key is read from the OPENAI_API_KEY environment variable:
export OPENAI_API_KEY=your-key # Linux/macOS
set OPENAI_API_KEY=your-key # Windows cmdIf the variable is not set, the app falls back to config.json on the classpath. Copy the example and add your key:
cp src/main/resources/config.example.json src/main/resources/config.json{
"api": {
"openai": {
"token": "your-key"
}
}
}config.json is listed in .gitignore.
Run from the repository root, since the OCR model is loaded from ./tessdata:
mvn compile exec:java -Dexec.mainClass="org.codered.neolithic.Neolithic"- Press
Ctrl+Shiftto start a capture. A preview window opens. - Click and drag over the area you want. The preview updates when you release the mouse.
- Click Accept (or press the hotkey again). Press
Escor close the preview to cancel. - In the "Converted Text" dialog, correct the OCR text if needed and enter an instruction. Refresh Text runs OCR on the image again.
- Click Send to AI. The response appears in a chat window, where you can ask follow-up questions.
Closing the chat window exits the application.
src/main/java/org/codered/neolithic/
Neolithic.java entry point
screenshot/ global hotkey and screen area selection
images/conversion/ Tesseract OCR
images/processing/ text cleanup, spelling and grammar correction
images/ui/ converted text dialog
openai/ OpenAI request and chat window
utils/ API key lookup (environment variable or config.json)
tessdata/ English Tesseract model