Skip to content

Latest commit

 

History

1 Commit

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Action Item Extractor

A FastAPI web application that converts free-form notes into structured, trackable action items. Supports both heuristic-based pattern matching and LLM-powered extraction via Ollama.

Project Structure

ActionItemExtractor_LLM/
├── app/
│   ├── main.py              # FastAPI app entry point and startup
│   ├── db.py                # SQLite database layer
│   ├── schemas.py           # Pydantic request/response models
│   ├── routers/
│   │   ├── action_items.py  # Action item endpoints
│   │   └── notes.py         # Note endpoints
│   └── services/
│       └── extract.py       # Extraction logic (heuristic + LLM)
├── frontend/
│   └── index.html           # Web frontend
├── tests/
│   └── test_extract.py      # Unit tests for extraction
├── requirements.txt         # Python dependencies
└── data/
    └── app.db               # SQLite database (auto-created)

Setup

Prerequisites

  • Python 3.10+
  • Ollama (for LLM extraction)

Installation

  1. Create and activate a virtual environment:

    python -m venv venv
    source venv/bin/activate
    
  2. Install dependencies:

    pip install -r requirements.txt
    
  3. (Optional) Set up environment variables:

    cp .env.example .env
    

    Edit .env to change the Ollama model if desired. The default is llama3.1:8b.

  4. Install and start Ollama, then pull a model:

    ollama pull llama3.1:8b
    

    You can use any Ollama-compatible model by updating OLLAMA_MODEL in your .env file.

Running the Application

Start the development server:

uvicorn app.main:app --reload

Then open http://127.0.0.1:8000/ in your browser.

API Endpoints

Notes

Method Endpoint Description
POST /notes Create a new note
GET /notes List all saved notes
GET /notes/{note_id} Get a single note by ID

Action Items

Method Endpoint Description
POST /action-items/extract Extract action items using pattern matching
POST /action-items/extract-llm Extract action items using Ollama LLM
GET /action-items List all action items (optional ?note_id= filter)
POST /action-items/{id}/done Mark an action item as done or undone

Request/Response Examples

Extract action items:

POST /action-items/extract
{"text": "- Buy groceries\n- Walk the dog", "save_note": true}

Response:
{"note_id": 1, "items": [{"id": 1, "text": "Buy groceries"}, {"id": 2, "text": "Walk the dog"}]}

Mark item done:

POST /action-items/3/done
{"done": true}

Response:
{"id": 3, "done": true}

Running Tests

Run all tests:

pytest tests/test_extract.py -v

Note: The LLM tests (test_llm_*) require Ollama to be running with a model pulled. The heuristic test (test_extract_bullets_and_checkboxes) runs without any external dependencies.

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages