Metadata-Version: 2.4
Name: askbase
Version: 1.0.0
Summary: Question answering for local knowledge bases with exact source citations.
Requires-Python: ~=3.13.0
Requires-Dist: docling==2.92.0
Requires-Dist: litellm==1.83.14
Requires-Dist: mnn==3.5.0
Requires-Dist: rapidocr-onnxruntime==1.4.4
Requires-Dist: rapidocr==3.8.1
Requires-Dist: tenacity==9.1.4
Description-Content-Type: text/markdown

# askbase

Question answering for local knowledge bases with exact source citations.

## Setup

```bash
uv sync
```

Set these environment variables before indexing or asking questions:

- `ASKBASE_MODEL`
- `ASKBASE_MODEL_API_KEY`
- `ASKBASE_EMBEDDING_MODEL`
- `ASKBASE_EMBEDDING_MODEL_API_KEY`
- `ASKBASE_EMBEDDING_BATCH_SIZE`

## Usage

Build a local SQLite index for a directory:

```bash
askbase index -d /path/to/docs
```

This writes `.askbase/askbase.sqlite` inside the target directory.

Ask a question against that index:

```bash
askbase ask -d /path/to/docs "What does the source say?"
```

## Main Files

- `askbase/cli.py`: command-line entry point.
- `askbase/index.py`: indexes source files into SQLite.
- `askbase/extract.py`: extracts text from Markdown, text, and PDF files.
- `askbase/chunk.py`: creates line-preserving chunks.
- `askbase/db.py`: stores documents, chunks, FTS rows, and embeddings.
- `askbase/search.py`: combines BM25 and embedding retrieval.
- `askbase/answer.py`: builds evidence prompts and validates citations.
