Skip to content

hackny/pil-intake

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

hackNY Public Interest Lab: Intake Processor

An AI-powered tool for processing unstructured nonprofit communications into structured entity data, relationship maps, and actionable follow-ups. Built for the hackNY Public Interest Lab, a pro bono program that matches technologists with civic organizations.

The Problem

Nonprofits drown in unstructured communication: emails from potential partners, intake forms, meeting notes, grant reports. The information trapped in these documents (who works where, who referred whom, what they need, what the timeline is) is exactly what organizations need to manage relationships effectively, but extracting it requires hours of manual data entry.

This is a language problem, and language problems are where AI tools have become genuinely useful.

What This Does

Paste raw unstructured text (an email, intake form, or meeting notes) and the system:

  1. Extracts entities (people, organizations, locations, dates, dollar amounts) using local NLP
  2. Infers relationships (who works where, who referred whom, partnership connections)
  3. Categorizes the communication (partnership inquiry, funding, technical assistance, etc.)
  4. Suggests follow-ups (specific next actions based on the content)

Architecture: Modular AI

The core design principle is backend independence. The system has two processing stages:

                          +------------------+
                          |   Raw Text       |
                          |   (email, form,  |
                          |    notes)        |
                          +--------+---------+
                                   |
                          Stage 1: Local NER
                          (spaCy, always runs,
                           free, no data leaves
                           the machine)
                                   |
                          +--------+---------+
                          |   Entities       |
                          |   {people, orgs, |
                          |    dates, ...}   |
                          +--------+---------+
                                   |
                  Stage 2: LLM Enhancement (optional)
                                   |
               +-------------------+-------------------+
               |                   |                   |
        +------+------+    +------+------+    +-------+-----+
        |   Claude    |    |    GPT      |    |    Local    |
        |  (Anthropic)|    |  (OpenAI)   |    |  (spaCy)   |
        +------+------+    +------+------+    +-------+-----+
               |                   |                   |
               +-------------------+-------------------+
                                   |
                          +--------+---------+
                          |   Structured     |
                          |   Output:        |
                          |   relationships, |
                          |   follow-ups,    |
                          |   categories     |
                          +------------------+

Why modular? Nonprofits have constraints that tech companies don't:

  • Data sensitivity: Client data may require on-premise processing. The local backend never sends data anywhere.
  • Budget: API costs matter when you're grant-funded. spaCy is free.
  • Vendor independence: Institutional agreements may require specific providers. Swap backends without changing a line of application code.
  • Auditability: The ABC pattern means each backend's behavior is testable and inspectable independently.

Quick Start

# Clone
git clone https://github.com/hackNY/pil-intake.git
cd pil-intake

# Install dependencies
pip install -r requirements.txt
python3 -m spacy download en_core_web_sm

# Run (works immediately with local backend, no API keys needed)
streamlit run app.py

To use Claude or GPT backends, set environment variables:

export ANTHROPIC_API_KEY=sk-ant-...    # for Claude
export OPENAI_API_KEY=sk-...           # for GPT

Or enter API keys in the sidebar at runtime.

Project Structure

pil-intake/
  app.py                  # Streamlit UI
  backend/
    base.py               # LLMBackend abstract base class
    claude_backend.py     # Anthropic Claude implementation
    openai_backend.py     # OpenAI GPT implementation
    local_backend.py      # spaCy-only fallback (no API key needed)
  processor/
    extractor.py          # spaCy NER + entity extraction
    pipeline.py           # Two-stage orchestration pipeline
  examples/
    nonprofit_email.txt   # Sample partnership inquiry
    intake_form.txt       # Sample intake form response
    meeting_notes.txt     # Sample scoping call notes

How It Fits PIL's Mission

The hackNY Public Interest Lab connects skilled technologists with civic organizations for focused, finite engagements. This intake processor is infrastructure for that mission: it helps PIL staff and fellows quickly understand incoming nonprofit communications, map the relationship landscape, and identify actionable next steps.

The modular AI architecture reflects PIL's values:

  • Nonprofit-first design: Works offline, works free, works without vendor lock-in
  • Transparency: Every extraction is inspectable; raw JSON output is always available
  • Practical scope: Solves a real workflow problem (intake processing) rather than promising a general-purpose AI platform

License

MIT

Links

About

AI-powered intake processor for nonprofit relationship management

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages