AI Assistant
BlockVault includes an on-device AI assistant that runs entirely on the user's phone — no data is sent to external servers. It understands natural language and can interact with wallet features through tool calling.
Model
| Property | Value |
|---|---|
| Model | Gemma 3 1B Instruction-Tuned |
| Training | SFT + GRPO fine-tuning on BlockVault-specific dataset |
| Quantization | INT4_BLOCK32 (CPU), FP16 (GPU) |
| Runtime (Android) | LiteRT-LM (.litertlm files) |
| Runtime (iOS) | MediaPipe Tasks GenAI (.task files) with Metal GPU |
Performance
| Backend | Speed | Notes |
|---|---|---|
| GPU (OpenCL) | ~20 tok/s | Not compatible with INT4 quantized models |
| CPU (XNNPack) | ~10–15 tok/s | Default — more stable and compatible |
The model is downloaded on first use and cached in the app's documents directory. Downloads are resumable.
Agent Architecture (ReAct)
The AI uses a ReAct (Reasoning + Acting) pattern implemented with LangGraph. Three specialized sub-agents work in sequence:
User message
↓
Classifier → "Can I answer directly, or do I need a tool?"
↓ (direct) ↓ (tool_needed)
Final answer Tool Selector → "Which tool(s)?"
↓
Tool Caller → Execute tool(s) → Observe result
↓
Final answer (with tool results)Sub-agents
| Agent | Purpose | Temperature |
|---|---|---|
| Classifier | Decide if the query needs a tool or can be answered directly | 0.1 |
| Tool Selector | Pick the right tool(s) — supports multi-tool chains | 0.3 |
| Tool Caller | Execute tools, parse results, handle follow-ups | 0.3 |
The Tool Caller supports up to 5 tool calls per conversation and can ask the user for missing information before executing.
Available Tools
The AI has access to 10 tools that bridge natural language to wallet operations:
| Tool | What it does |
|---|---|
get_balance | Check crypto balance for an asset or address |
get_assets | List available assets, filtered by blockchain or balance |
get_price | Current market price for one or more symbols |
get_historical_price | OHLCV candle data for trend analysis (1h, 4h, 1d, 1w intervals) |
get_transaction_history | Past transactions for a blockchain |
transfer | Navigate to the send screen with pre-filled recipient and amount |
estimate_fee | Calculate transaction cost (slow/normal/fast) |
receive_crypto | Show deposit address with QR code |
calculate_goal | Investment target planning — how much needed to reach a goal |
calculate_dca | Dollar-cost averaging strategy calculation |
Multi-tool chains
Tools can be chained in sequence for complex queries:
"How much more ETH do I need to reach $10,000?"
→ get_balance (check current ETH)
→ get_price (get current ETH price)
→ calculate_goal (compute the gap)Wallet integration
Tools interact with real wallet data:
- get_balance queries the local database (AssetsEntity + BalanceEntity)
- transfer opens the send screen with pre-filled fields
- receive_crypto shows a modal with the wallet's QR code
- If the user doesn't specify an asset, the AI shows a selector modal to let them pick
Conversation Example
User: "What's my Bitcoin balance?"
┌─ Classifier ─────────────────────────┐
│ Needs tool: yes → tool_needed │
└──────────────────────────────────────┘
↓
┌─ Tool Selector ──────────────────────┐
│ Tool: get_balance │
│ Reason: user asks for balance │
└──────────────────────────────────────┘
↓
┌─ Tool Caller ────────────────────────┐
│ <tool_call> │
│ get_balance(symbol: "BTC") │
│ </tool_call> │
│ │
│ Observation: { balance: "0.5423" } │
│ │
│ Answer: You have 0.5423 BTC. │
└──────────────────────────────────────┘Thinking Process
The model uses <think> tags for internal reasoning, visible to the user as an expandable "thinking" section:
<think>
The user wants to know their Bitcoin balance.
I need to call get_balance with symbol BTC.
</think>Each ReAct iteration shows: thought → action → observation — giving users transparency into the AI's decision-making.
Training Pipeline
The model is fine-tuned on a custom dataset (~3,500+ examples) covering:
| Conversation type | Description |
|---|---|
| Single tool | One tool call per conversation |
| Clarification | 6+ turns asking for missing parameters |
| Multi-tool | Sequential tools passing results between them |
| Dynamic | Model decides next tool based on previous results |
| Error handling | Tool fails, model explains the issue |
| Partial execution | Plans more tools than executed |
| Deflection | User changes topic mid-conversation |
Training uses two phases:
- SFT (Supervised Fine-Tuning) — learns the format and tool-calling syntax
- GRPO (Group Relative Policy Optimization) — optimizes tool selection accuracy, parameter validation, JSON formatting, and safety