# typeagent Status

Last updated: 2026-04-10

## Current state

Optimization work is active. 6 optimizations completed, 2 PRs merged, 4 PRs open.

## Target repo

`~/Desktop/work/microsoft_org/typeagent` on branch `perf/defer-query-imports`

## PRs

| PR | Branch | Status | Description |
|---|---|---|---|
| #229 | `perf/defer-black` | Merged | Defer black import to first use |
| #231 | `fix/parse-azure-endpoint` | Merged | Fix parse_azure_endpoint query string bug |
| #230 | `perf/batch-inserts` | Open | Batch SQLite INSERTs for indexing pipeline |
| #232 | `perf/batch-metadata-query` | Open | Batch metadata query to avoid N+1 across 5 call sites |
| #234 | `perf/vectorbase-numpy` | Open (stacked on #232) | Vectorize fuzzy_lookup_embedding with numpy ops |
| #235 | `perf/optional-black` | Open (stacked on #234) | Replace black with stdlib pprint for runtime formatting |
| #236 | `perf/defer-query-imports` | Open (stacked on #235) | Defer query-time imports in conversation_base |

## Key results

- **Import**: 791ms → 683ms (1.16x cumulative) via defer-black + optional-black + defer-query-imports
- **Batch inserts**: 1.16x on add_messages_with_indexing
- **Vectorbase**: 3.7x-14.2x on fuzzy_lookup_embedding (numpy ops)
- **Metadata query**: 2.1x-2.6x on lookup/group/scope operations

## VM

- **IP**: 40.65.81.123
- **Size**: Standard_D2s_v5
- **RG**: typeagent-BENCH-RG
- **State**: Unknown (check with `az vm show -g typeagent-BENCH-RG -n typeagent-bench -d --query powerState -o tsv`)

## Next

- Check PR review feedback on #230, #232, #234, #235, #236
- Profile for more import time optimizations (currently 683ms, aim for absolute floor)
- Investigate lightweight query path (branch `perf/lightweight-query` exists but no PR yet)
- pydantic_ai accounts for ~161ms of import time — upstream opportunity, noted in #236 body
- Update README.md with final results table

## Local branches to clean up

- `perf/vectorbase-lookup` — superseded by `perf/vectorbase-numpy`
- `perf/benchmark-tests` — merged into individual PRs
