Metadata-Version: 2.4
Name: lemma-ai
Version: 0.1.0
Summary: Local-first paper manager with semantic search and LLM reasoning
Home-page: https://github.com/alMohimanul/lemma
Author: Mahir
Author-email: aislam192054@gmail.com
Classifier: Development Status :: 3 - Alpha
Classifier: Intended Audience :: Science/Research
Classifier: Topic :: Scientific/Engineering
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Requires-Python: >=3.10
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: click>=8.1.0
Requires-Dist: pypdf2>=3.0.0
Requires-Dist: pdfplumber>=0.11.0
Requires-Dist: sentence-transformers>=2.3.0
Requires-Dist: faiss-cpu>=1.7.4
Requires-Dist: sqlalchemy>=2.0.0
Requires-Dist: groq>=0.4.0
Requires-Dist: google-generativeai>=0.3.0
Requires-Dist: httpx>=0.26.0
Requires-Dist: rich>=13.7.0
Requires-Dist: python-dotenv>=1.0.0
Provides-Extra: dev
Requires-Dist: pytest>=7.4.0; extra == "dev"
Requires-Dist: pytest-cov>=4.1.0; extra == "dev"
Requires-Dist: ruff>=0.1.9; extra == "dev"
Requires-Dist: mypy>=1.8.0; extra == "dev"
Requires-Dist: pre-commit>=3.5.0; extra == "dev"
Requires-Dist: build>=1.0.0; extra == "dev"
Requires-Dist: twine>=4.0.0; extra == "dev"
Dynamic: author
Dynamic: author-email
Dynamic: classifier
Dynamic: description
Dynamic: description-content-type
Dynamic: home-page
Dynamic: license-file
Dynamic: provides-extra
Dynamic: requires-dist
Dynamic: requires-python
Dynamic: summary

# 📚 Lemma - Local-First Research Paper Manager

> A privacy-first research paper manager with local semantic search and optional AI-powered insights.

[![Python 3.10+](https://img.shields.io/badge/python-3.10+-blue.svg)](https://www.python.org/downloads/)
[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)

## Features

- 🔒 **Privacy-First**: All papers stored locally, no cloud uploads
- 🚀 **Fast Semantic Search**: Local vector search across all papers
- 🤖 **AI Q&A (Optional)**: Ask questions using cloud LLMs
- 📊 **Smart Organization**: Automatic metadata extraction and file naming
- 🔄 **Incremental Updates**: Only processes new papers
- 📂 **Duplicate Detection**: SHA256-based deduplication

## Installation

```bash
# Install via pip
pip install lemma-ai

# Or with pipx (recommended for CLI tools)
pipx install lemma-ai
```

## Quick Start

```bash
# Scan your papers directory
lemma scan ~/Documents/Papers

# List indexed papers
lemma list

# Search by keyword
lemma search "machine learning"

# Generate embeddings for semantic search (runs locally)
lemma embed

# Organize files with smart renaming
lemma organize --dry-run

# Verify database integrity
lemma verify
```

## Optional: AI Features

For AI-powered Q&A, set up an API key (completely optional):

```bash
# Set environment variable
export GROQ_API_KEY="your_key_here"

# Or create .env file
echo "GROQ_API_KEY=your_key_here" > .env

# Ask questions across your library
lemma ask "What are the main approaches to polyp segmentation?"
```

Get free API keys:
- [Groq](https://console.groq.com/) - Fast and generous free tier (recommended)
- [Google Gemini](https://makersuite.google.com/) - Alternative option

## Requirements

- Python 3.10 or higher
- macOS (Linux/Windows support coming soon)
- ~500MB disk space for embedding models

## Privacy

- **All papers stay on your machine** - never uploaded anywhere
- **Embeddings generated locally** - no external API calls
- **Cloud APIs only used for optional Q&A feature** - and only if you configure keys
- **Database stored locally** at `~/.lemma/lemma.db`

## Commands

| Command | Description |
|---------|-------------|
| `lemma scan <dir>` | Scan directory for PDFs |
| `lemma list` | List all indexed papers |
| `lemma search <query>` | Search papers by keyword |
| `lemma info <id>` | Show paper details |
| `lemma embed` | Generate embeddings (local) |
| `lemma ask <question>` | Ask questions (requires API key) |
| `lemma organize` | Rename files based on metadata |
| `lemma verify` | Check database integrity |

## License

MIT License - see LICENSE file for details

## Support

- Report issues: [GitHub Issues](https://github.com/alMohimanul/lemma/issues)
- Questions: Open a discussion on GitHub
