Skip to main content

Radio astronomy tidbits

Project description

africalim

Open-source agentic harness for radio-interferometry tooling.

africalim is a small, focused CLI that runs LLM-powered agents over a configurable corpus of radio-interferometry repositories. The first release ships exactly one agent — janskie — a general-purpose Q&A bot that answers questions about radio-imaging tooling and cites the source files it pulled from.

You bring your own API key (Anthropic, OpenAI, Gemini, OpenRouter, Groq — any provider that pydantic-ai supports). africalim never reads keys from disk; only from environment variables.

Quickstart

pip install africalim                                   # or uv add africalim
export ANTHROPIC_API_KEY=sk-ant-...                     # or any other supported provider's key
africalim janskie "what does the gridding step in pfb-imaging actually do?"

The first run will prompt you about consent (see Privacy, below). The default model is claude-sonnet-4-6.

Supported providers

Set the env var matching the provider you want to use:

Provider Env var
Anthropic ANTHROPIC_API_KEY
OpenAI OPENAI_API_KEY
Gemini GOOGLE_API_KEY
OpenRouter OPENROUTER_API_KEY
Groq GROQ_API_KEY
Mistral MISTRAL_API_KEY
Cohere COHERE_API_KEY

Override the default per call:

africalim janskie --provider openai --model gpt-4o-mini "..."

Or persistently, in ~/.config/africalim/config.toml:

[model]
default_provider = "anthropic"
default_model    = "claude-sonnet-4-6"

(Edit via africalim config set model.default_model claude-haiku-4-5.)

Pointing at a corpus

For v0.1.0 you clone the repos you want janskie to read from and tell africalim where they live. Edit ~/.config/africalim/corpus.toml:

[[repo]]
name = "pfb-imaging"
path = "~/.cache/africalim/corpus/pfb-imaging"
url  = "https://github.com/ratt-ru/pfb-imaging"
ref  = "main"

[[repo]]
name = "QuartiCal"
path = "~/.cache/africalim/corpus/QuartiCal"
url  = "https://github.com/ratt-ru/QuartiCal"
ref  = "main"

africalim corpus sync (auto-cloning) is on the v0.2.0 roadmap; for now, clone manually:

mkdir -p ~/.cache/africalim/corpus
git clone https://github.com/ratt-ru/pfb-imaging ~/.cache/africalim/corpus/pfb-imaging
git clone https://github.com/ratt-ru/QuartiCal   ~/.cache/africalim/corpus/QuartiCal

Verify by asking janskie a corpus-grounded question:

africalim janskie --question "How does pfb-imaging select a gridder backend?"

A working setup produces a confidence: medium or high answer with one or more entries under Sources pointing at concrete files. Three behaviours to know about:

  • No corpus configured. Janskie refuses code-specific questions and returns confidence: low with a caveat telling you to run africalim config / edit corpus.toml. Same response when corpus.toml exists but has no [[repo]] entries.
  • Configured repo whose path is missing on disk. Janskie prints a warning: corpus repo 'X' at ... does not exist; skipping line to stderr and continues with the repos that do exist. Use this to spot stale or typo'd paths quickly.
  • All configured repos missing. Janskie behaves as if no corpus is configured.

Inspecting and exporting your interactions

Every agent call is logged to a local SQLite database under your platform's user data directory (~/.local/share/africalim/interactions.db on Linux). API keys are never logged.

africalim export --consent all --output ~/africalim-dump.jsonl    # everything
africalim export --agent janskie --since 2026-01-01               # filtered
africalim export                                                  # default: only opt_in records

Filter values for --consent: opt_in (default), opt_out, unset, all.

Privacy

africalim is privacy-by-default: the first run defaults to opt out. Opting in marks records as eligible for upload to a future project-run aggregator endpoint (the endpoint itself is not active in v0.1.0 — opting in is informative only). Full policy in PRIVACY.md.

Change your mind at any time:

africalim config set consent.status opt_in
africalim config set consent.status opt_out

CLI reference

africalim janskie "<question>"     # ask a question
africalim config show              # print the user config
africalim config set <key> <value> # update a config value (dotted key)
africalim config path              # print the path of the user config file
africalim export [...]             # dump logged interactions as JSONL

What's in scope for v0.1.0

  • janskie (Q&A agent with citations)
  • BYO-API-key model resolution
  • Local SQLite interaction log + opt-in upload flag
  • TOML user config + corpus config
  • JSONL export

What's deferred

  • Any agent other than janskie (e.g. a calibration specialist).
  • The remote interaction-aggregator endpoint.
  • Auto-cloning corpus repos (africalim corpus sync).
  • The Streamlit review app (africalim review).
  • Embedding-based retrieval (BM25/ripgrep is enough until a concrete failure case demands more).

See plans/africalim_technical_spec.md §8 for the full out-of-scope list and CONTRIBUTING.md for how to propose new work.

Development

git clone https://github.com/landmanbester/africalim
cd africalim
uv sync --group dev --group test
uv run pre-commit install
uv run pre-commit install --hook-type commit-msg
uv run pytest

See CONTRIBUTING.md for the full guide, including the architectural invariants every PR is checked against.

License

MIT — see LICENSE.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

africalim-0.0.1.tar.gz (38.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

africalim-0.0.1-py3-none-any.whl (52.5 kB view details)

Uploaded Python 3

File details

Details for the file africalim-0.0.1.tar.gz.

File metadata

  • Download URL: africalim-0.0.1.tar.gz
  • Upload date:
  • Size: 38.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for africalim-0.0.1.tar.gz
Algorithm Hash digest
SHA256 4b8746b7a733b59ff75850aaffe3c7b602973c59839cae1cc238b0f955f67be1
MD5 0d9f264b75790ebcb3e1752ecd128440
BLAKE2b-256 1dadbdce0bb3538bae68d2935b852408c11e74ea0aada2c8bfa46edbec946f76

See more details on using hashes here.

Provenance

The following attestation bundles were made for africalim-0.0.1.tar.gz:

Publisher: publish.yml on landmanbester/africalim

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file africalim-0.0.1-py3-none-any.whl.

File metadata

  • Download URL: africalim-0.0.1-py3-none-any.whl
  • Upload date:
  • Size: 52.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for africalim-0.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 9b68edc8a13b7e022add4ed0472731a976efe828ce9046a500858f943fb83409
MD5 5d4a9e423599f19704bbc8169c166956
BLAKE2b-256 9f9b57bd501a7cc40fc72b48ad25fa4d1cd0567c32ba9a9aaa0f258578d1cf3e

See more details on using hashes here.

Provenance

The following attestation bundles were made for africalim-0.0.1-py3-none-any.whl:

Publisher: publish.yml on landmanbester/africalim

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page