A Phoenix application that downloads and summarizes JFK documents in PDF format using Elixir, Rust, and LangChain.
- Download PDFs from URLs
- Extract text from PDFs using Rust NIF with the extractous crate
- Summarize text using LangChain and OpenAI's API
- Browse JFK documents from the National Archives
- Elixir 1.18+
- Erlang/OTP 27+
- Rust and Cargo
- OpenAI API key
-
Clone the repository:
git clone <repository-url> cd jfk_pdf_summarizer
-
Install dependencies:
mix deps.get
-
Configure OpenAI API key: Edit
config/dev.secret.exsand add your OpenAI API key:import Config # LangChain configuration with OpenAI config :langchain, openai: [ api_key: "your_openai_api_key_here" ] # Set the OpenAI API key as an environment variable config :openai, api_key: "your_openai_api_key_here"
-
Compile the project:
mix compile
-
Start the Phoenix server:
mix phx.server
Now you can visit localhost:5000 from your browser.
- Document Acquisition: The application downloads PDF documents from URLs or allows users to upload their own files.
- Text Extraction: A high-performance Rust NIF extracts text content from PDFs using the extractous crate.
- AI Summarization: The extracted text is processed through LangChain and OpenAI to generate concise, informative summaries.
- Presentation: Results are displayed in a clean, user-friendly interface, with options to view both the original text and the summary.
lib/jfk_pdf_summarizer/pdf_processor.ex- Core logic for downloading, extracting, and summarizing PDFslib/jfk_pdf_summarizer/pdf_extractor.ex- Elixir interface to the Rust NIFnative/pdf_extractor/- Rust implementation of the PDF extraction functionalitylib/jfk_pdf_summarizer/jfk_documents.ex- Module for handling JFK document collectionlib/jfk_pdf_summarizer_web/- Phoenix web interface
- Fork the repository
- Create your feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add some amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
This project includes a GitHub Pages site in the docs/ directory. To view it locally:
-
Install Jekyll and Bundler:
gem install jekyll bundler
-
Navigate to the docs directory:
cd docs -
Install dependencies:
bundle install
-
Start the local server:
bundle exec jekyll serve -
Visit
http://localhost:4000in your browser.
This project is licensed under the MIT License - see the LICENSE file for details.
- National Archives for providing access to JFK assassination records
- Phoenix Framework for the web interface
- LangChain and OpenAI for AI summarization capabilities
- Extractous and Rustler for PDF text extraction