> ## Documentation Index
> Fetch the complete documentation index at: https://docs.uselim.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Natural Language Input

> Add journal entries by describing transactions in plain language.

# Natural Language Input

`lim add` turns plain-text descriptions into double-entry journal entries. No accounting knowledge required.

## How It Works

<Steps>
  <Step title="Rule Match (instant, zero cost)">
    Deterministic pattern matching. If you've recorded "AWS" before, the rule fires immediately.
  </Step>

  <Step title="History Match (fast, zero cost)">
    SQL lookup of similar past transactions by vendor name, amount range, and description keywords.
  </Step>

  <Step title="AI Inference (when needed)">
    Called only when rules and history can't resolve. Uses the LLM to classify the transaction.
  </Step>

  <Step title="Escalate (low confidence)">
    If confidence is below threshold, lim asks you to confirm before posting.
  </Step>
</Steps>

<Tip>
  Over time, almost all transactions resolve at Step 1. AI costs approach zero as rules accumulate.
</Tip>

## Basic Usage

```bash theme={null}
lim add "AWS 11000 yen credit card"
```

```
✅ Communication     10,000 / Accounts payable  11,000
   Input VAT          1,000
📚 Learned rule for "AWS" (auto-suggest next time)
```

lim automatically:

* Maps "AWS" to Communication expense
* Detects "11000 yen" as tax-inclusive (税込)
* Decomposes: ¥10,000 expense + ¥1,000 consumption tax (10%)
* Credits Accounts Payable for the credit card liability

## Tax-Inclusive Decomposition

When an amount is tax-inclusive, lim extracts the tax automatically:

```bash theme={null}
lim add "office supplies 1080 yen cash"
```

```
✅ Supplies            1,000 / Cash              1,080
   Input VAT             80
   (8% reduced rate detected — stationery)
```

<Warning>
  lim defaults to 10% consumption tax. For 8% reduced-rate items (food, newspapers), specify
  explicitly or let the AI infer from context.
</Warning>

## File Attachments

Attach receipt photos or PDF invoices. lim extracts vendor, amount, date, and line items:

```bash theme={null}
lim add "expense" --file receipt.jpg
```

```
📷 Scanned: Tokyu Hands, ¥3,300, 2026-03-15
✅ Supplies          3,000 / Cash              3,300
   Input VAT          300
📎 receipt.jpg attached to journal entry je_01K3...
```

Supported formats: **PNG, JPG, GIF, WebP, PDF**.

<CodeGroup>
  ```bash Single file theme={null}
  lim add "lunch meeting" --file receipt.jpg
  ```

  ```bash Multiple files theme={null}
  lim add "travel expense" --file ticket.pdf --file hotel.jpg
  ```
</CodeGroup>

## The Learning Engine

lim learns from your confirmations:

| Confirmations | Behavior                                         |
| ------------- | ------------------------------------------------ |
| 0             | AI inference, requires confirmation              |
| 1             | Suggests the same mapping, requires confirmation |
| 2             | Suggests with high confidence                    |
| 3+            | **Auto-posts** — no confirmation needed          |

```bash theme={null}
# First time: lim asks for confirmation
lim add "Slack 1760 yen credit card"
# => 🤔 Communication ¥1,600 + VAT ¥160 / AP ¥1,760? (y/n)

# After 3 confirmations: auto-posts
lim add "Slack 1760 yen credit card"
# => ✅ Auto-posted (rule: slack-monthly)
```

## Advanced Examples

```bash theme={null}
# Specify accounts explicitly
lim add "rent 220000 bank transfer" --debit 7200 --credit 1200

# Set a specific date
lim add "AWS 11000 yen credit card" --date 2026-03-01

# Tax-exempt transaction
lim add "overseas consulting fee 500000 yen" --tax-code exempt

# Add a memo
lim add "dinner with client 8800 yen" --memo "Project kickoff dinner"
```

## How Accuracy Improves Over Time

```
Month 1:  Rule 20% │ History 30% │ AI 40% │ Escalate 10%
Month 3:  Rule 60% │ History 20% │ AI 15% │ Escalate  5%
Month 6:  Rule 85% │ History 10% │ AI  4% │ Escalate  1%
Month 12: Rule 95% │ History  3% │ AI  1% │ Escalate  1%
```

## Next Steps

<CardGroup cols={2}>
  <Card title="Journal Entries" icon="book" href="/guides/journal-entries">
    Manual entry creation and bulk operations.
  </Card>

  <Card title="Judgment Engine" icon="brain" href="/agents/judgment-engine">
    Deep dive into the rule/history/AI/escalate pipeline.
  </Card>
</CardGroup>
