Skip to content

Getting Started

Prerequisites

  • Python 3.11+
  • pip or Docker
Terminal window
git clone https://github.com/dsantoreis/askbase.git && cd askbase
docker-compose up

The API starts at http://localhost:8080 with sample docs pre-loaded via --seed.

Option B: Local install

Terminal window
git clone https://github.com/dsantoreis/askbase.git && cd askbase
python3 -m venv .venv && source .venv/bin/activate
pip install -e '.[dev]'

Ingest documents

Drop your .txt, .md, or .pdf files into a folder and ingest them:

Terminal window
rag ingest docs/ data/seed/

This chunks, embeds (TF-IDF), and indexes everything into artifacts/rag_index.pkl.

Start the server

Terminal window
rag serve --seed --host 0.0.0.0 --port 8080

--seed auto-ingests data/seed/ on first run if no index exists yet.

Ask a question

Terminal window
curl -s -X POST http://localhost:8080/ask \
-H "Authorization: Bearer user-demo-token" \
-H "Content-Type: application/json" \
-d '{"query": "How do I reset my password?"}' | python3 -m json.tool

You get a grounded answer with citations pointing to exact document locations.

CLI commands

CommandWhat it does
rag ingest <paths...>Chunk and index documents
rag ask "<question>"Query the index from the terminal
rag serveStart the FastAPI server
rag evaluate --dataset eval.jsonRun context precision evaluation
rag statusShow index stats (chunk count, path)

CLI options

Terminal window
# Custom chunk size and overlap
rag ingest docs/ --chunk-size 300 --overlap 50
# JSON output for scripting
rag ask "What plans exist?" --json --top-k 5
# Custom index path
rag serve --index /data/production.pkl --port 9090

Next steps