v0.2 alpha · open source · MIT
Hey Ira.
A self-hosted voice assistant over your own data and tools. It looks things up on its own, and changes nothing until the owner types a PIN.
Built in Python with FastAPI. You write the tools; Ira answers by text or voice on the web, on Telegram and over an HTTP API.
examples/clinic, answered by the no-key demo router, which matches keywords.
With a real model in the chain you can ask in your own words.
Why it exists
A small business does not need a chatbot that can do anything. It needs one that knows its calendar, stock or orders, answers when the owner's hands are busy, and cannot change anything without the owner saying so.
- Hosted models go down, time out or say they are busy.
-
Fallback model chains
A tier is an ordered list of models: any OpenAI-compatible server (local ones too), the Anthropic API or Amazon Bedrock. On an error, a timeout or a capacity refusal the next model answers, and the one that failed cools down.
- A general chatbot knows nothing about your business.
-
Tools over your own data
You write ordinary typed Python functions. The signature becomes both the JSON schema the model sees and the validation applied before your code runs.
- A model can be wrong, confused or talked into things.
-
Actions only after a PIN
A tool that changes something only creates a proposal with a plain summary. It runs once, after the owner enters the PIN, and the PIN never reaches a model.
- People speak the way they speak.
-
Hinglish and Indian English, in and out
The speech-to-text prompt asks for the words exactly as spoken, in the language spoken, and says plainly not to translate, because speech models sometimes turn a Hinglish sentence into English. A vocabulary list helps with names. For spoken replies, Amazon Polly's
voiceandlanguage_codesettings pick an Indian-English voice. - You cannot trust what you cannot see.
-
Every call logged, with latency and cost
Each model request writes a row: the model that answered, the ones tried, attempts, seconds, tokens and the cost from your own price table. Never a key or a prompt. A read-only admin API reports the day's p50 and p95 latency.
How a PIN-confirmed action works
Ira may look things up on its own. To change anything it can only propose, and the owner's PIN is what makes the change happen.
- 1 · Ask “cancel appointment 3” Text or voice, on any channel.
-
2 · Propose
cancel_appointmentStored as pending for 120 seconds. Nothing has run, and the model is told so.(id=3) - 3 · PIN From the owner straight to the action guard. Never in the chat history, never sent to a model.
- 4 · Run once Done: Cancel appointment #3 … Your function runs exactly once, and the outcome goes to the audit log.
- At most once. A database compare-and-set moves the action from pending to executing, so two confirmations cannot run it twice.
- Wrong PINs lock. Three in a row lock every action for 15 minutes.
- Proposals expire. No PIN within 120 seconds, and nothing runs.
- A PIN on its own is never forwarded. On Telegram the message holding it is deleted before anything else happens.
Where you talk to it
One assistant, one conversation store, the same tools and the same PIN on every channel.
-
Web chat
Streamed answers, a microphone in the browser, spoken replies and the PIN card. Installable on a phone's home screen as a PWA.
/ -
Telegram
A paired private chat. Text and voice notes in; text, and voice when text-to-speech is set up, out. No inbound port: it uses long polling.
ira telegram pair -
HTTP API
JSON and server-sent events for your own apps, with OpenAPI docs. Tokens carry scopes: a phone token with scope
askcan only ask.POST /v1/ask
Run the example
Python 3.11 or newer. No API key needed: the example clinic runs on a keyword-routing demo provider, not a language model, so phrase things plainly.
git clone https://github.com/helloupendra/ira.git
cd ira
python3 -m venv .venv
source .venv/bin/activate
pip install -e .
cd examples/clinic
ira demo seed # fictional appointments
ira setup # owner email and password
ira pin set # the PIN that releases actions
ira serve # http://127.0.0.1:8765
Open http://127.0.0.1:8765, sign in, and try
find slots tomorrow, then cancel appointment 3.
To put a real model first in the chain, see
Getting started.
Status: alpha
IRA is at v0.2: the Ira app, the admin console at /admin and the API
behind them are in. It runs end to end; the configuration and API may still change
before 1.0.