Over the years I’d built up a few large boxes of parts: Arduino modules, microcontrollers, sensors, capacitors, connectors. Without a list it always ends the same way. It’s simpler to order something for a couple of złoty than to search for forty minutes, so the box grows, and on a weekend, instead of building something, you wait for a parcel with a part that was sitting in a box you just hadn’t gone through.
Then a new problem came along. I design circuits together with an AI agent, a program that writes its own code and carries out commands. The agent doesn’t know what’s in my boxes, so on every project it suggests buying things. The goal was simple: the agent should first check what components it already has available, and only then, if something is genuinely missing, give a shopping list.
The AI agent designed and wrote this whole system. I told it how I work and what gets in my way, took photos of the parts, and approved what went into the database. Today the inventory holds 583 parts, 438 of them with their own photo. Below is how that happened, along with the things we tried and rejected.
There’s no shortage of databases. There’s a shortage of a fast, easy way to take stock
There are plenty of programs for tracking parts, and every one of them can store data just fine. The problem sits elsewhere. A few boxes amount to hundreds of items, and typing one into a form by hand takes about half a minute. That adds up to a dozen or more hours of work that nobody ever finishes.
The second killer of such databases is drifting away from reality. After a project is built, nobody subtracts the parts that were used, so two months later the stock count is a lie and stops being trusted. It was clear from the start, then, that care had to go into two places at once: entering parts, and keeping the database in step with what’s actually on the shelf.
Three programs in one day
On the first day the foundation of the database changed three times. We started with Binner, because I’d used it before. It even got up and running. Then three facts came out: its development has stood still since April, there are no lasting access keys for other programs to use, and its best feature, automatic part-data lookup, runs through the author’s own server, which can’t be self-hosted because that requires the paid tier.
The second candidate, InvenTree, has a living repo and is properly built, but it’s a tool for manufacturing businesses: purchase orders, stock allocations, sales flags. Electronic part data is its least developed corner.
Part-DB won, and it won after a trial. The agent set it up, entered 21 parts and checked what actually works: pulling data from the LCSC catalogue with no key at all (description, manufacturer, package, PDF datasheet, photo), support for a dozen-odd shops including Poland’s TME, QR-code labels, and a built-in interface for AI agents. On top of that it uses 345 MB of memory, against roughly 1 GB for InvenTree.
One risk was written down explicitly: Part-DB is developed by practically one person, same as Binner. The difference is what happens if the author disappears. Binner lost its key feature when that happened. Part-DB would keep working, just stop gaining new features. That’s why we don’t change Part-DB itself, not by a single line. Everything that’s ours sits next to it and talks to it through its official interface.
A photo instead of a form
Parts get into the database like this: I take a phone photo, the photo waits in a queue, the agent looks at it and recognises what’s in it. Hobbyist modules have legible printing, for example HC-SR04 or ESP32-WROOM, so the agent can read them off.
Deliberately, there’s no separate image-recognition service. The same agent I talk to does the recognising, because it has one important advantage: faced with an uncertain photo, it asks instead of quietly writing down nonsense. Before settling on that, we checked three other routes.
- A smaller, cheaper AI model. Shown a test photo of a laptop keyboard with the instruction “don’t guess”, it said it was a MacBook and named a key that wasn’t in the shot. The larger model wrote “can’t see a brand”. For an inventory, a confident fabrication is the worst possible mistake, because it only surfaces once you’re building the circuit. This was a single trial, so I treat it as a hint, not proof.
- A model run on my own computer. It had to read a part’s data off a shop page. One model got it right in 366 seconds. Another in 84 seconds, but wrote the shop down as the manufacturer. The cause is hardware: my graphics cards don’t have enough memory for a model that size.
- Dictation through my own speech-recognition server. It was fast, but turned “fifty 1N4148 diodes” into “fifty-two point one E4148”, and “six boards” into “three board”. The test used synthetic speech, so a real voice might do better. Plain dictation from the phone’s keyboard won, for one reason: I see the text before I send it, and can fix it.
A technical aside for the curious. The agent “pays” for every photo with room in its working memory, counted in tokens. A photo straight off the phone (4080×3072 pixels) costs around 16,700 tokens, so ten photos would fill up an entire conversation. Shrinking the longer side down to 1568 pixels drops the cost to 2,469 tokens. It can’t go lower than that, because fine printing starts to disappear, and that’s the only information a module gets recognised by.
Resistors don’t get counted
Pretending I’ll count resistors down to the last one is the surest way to abandon the whole project. So parts split into two groups. Modules, microcontrollers and sensors are counted exactly, because they’re expensive and there aren’t many of them. The small stuff, resistors, capacitors, diodes and screws, only gets a range: a little, some, plenty. For the question “do I have enough to build this”, that’s entirely sufficient.
Stocktake first, boxes second
The original rule sounded sensible: sort the parts into bins first, then enter them bin by bin. It broke on one sentence of mine: I don’t know how much I have or in what categories, so it’s hard for me to design a structure. You can’t plan a split into boxes for a collection you don’t yet know.
The rule got turned around. A part can exist in the database with no box: “I have it, just don’t know where yet” is a perfectly valid state. Only once the whole picture is visible can you design a split and start putting parts where the database points. To be honest, that’s exactly where I am. The stocktake exists, and almost every part is still waiting for its box.
Two modules, one chip, one mistake
The most instructive bug came from real parts. I have two battery-charger modules. Both use the same TP4056 chip, but one also has battery protection and the other doesn’t. The database treated them as the same part, because the chip marking matched, and showed “2× charger with protection”.

This isn’t a minor detail. A module with no protection, wired straight to a bare cell, will discharge it below a safe level.
The lesson: a chip’s marking says which chip sits on the board, not what the whole board is. Dozens of different modules share the same marking. From now on, a matching chip marking next to a different name doesn’t silently merge parts. The program stops and asks whether it’s really the same thing. More questions, but merging two different parts by mistake costs more than one question ever would.
Eight parts in one photo
The simplest way to photograph a parcel of modules is to tip them out on the bench and shoot the whole lot. Eight modules means eight parts in the database, and each one got the same photo of the whole bench top as its thumbnail. The parts list then stopped doing its one job: letting you recognise an item by sight.
The fix is simple. For every part the agent gives four numbers: where it sits in the photo and how big it is. The crop isn’t saved as a separate file, it’s computed from the original whenever someone needs it. One photo stays on disk and in the backup, and a wrong crop gets fixed by changing four numbers. The same mechanism also serves the agent as a magnifying glass: printing that’s unreadable in the full frame can turn out to be readable once a piece of the original is enlarged.

The agent proposes, I approve
At first, recognising and saving were a single action, and I gave the go-ahead in conversation with the agent at my desk. After the first real run (31 photos, 206 parts) it was clear that wasn’t the right direction. Nothing could be approved from the phone, and nothing could be recognised without me being there, because every recognition wrote straight to the inventory.
So a proposal stage appeared between recognition and saving. I mark photos for recognition on the phone, and the agent wakes up on its own every hour and turns them into proposals. A proposal changes nothing in the inventory. The worst that can happen is a row I dismiss with one tap. Only my “Approve” creates a part.

One decision stayed deliberately with me: whether a proposal is a new part, or just another unit of something already in the database. Settling that means comparing two entries, and a phone screen can’t do that honestly. In exchange, the agent has no tool for creating boxes. A box gets created by the person holding it.
Warsztat: my own screen over someone else’s database
Part-DB has its own interface, but it’s a table with a dozen-plus columns. Held in one hand next to a shelf, a phone screen can’t read it. The everyday question, after all, is short: do I have this, what does it look like, and where is it.
So an overlay called Warsztat (“Workshop”) was built: a search box, browsing by category and box, working lists (“no box yet”, “needs checking”), a part card and an add screen. The look was designed in an interface-design tool, and the agent turned the design into a working site. Search is instant, because the phone pulls a compact list of every part once and searches it itself, without asking the server about every letter typed. It also understands Polish words typed without diacritics.
One thing to be clear this isn’t: a second database. Warsztat stores nothing of its own. Everything it shows lives in Part-DB, which has stayed the panel for the rare, administrative tasks.
One dead end, written down for others
A lot of my modules come from Allegro, so the obvious idea was reading listing data through the official developer interface. I registered an application, went through the authorisation, and the agent tried it live. The answer turned out to be “can’t be done”: listing search is only open to applications verified by Allegro, listing details can only be read by the seller themselves, and there’s no buyer purchase history in this interface at all. None of that is in the documentation, only in the server’s responses, which is why it’s written down here. For things from Allegro, the simpler path remains: I share a photo of the listing from my phone, and give the link and price once, in conversation.
What’s left standing
- Measure before you choose. The choice of program, AI model and dictation method each settled only after trials with a concrete result. Two of those trials sank ideas that looked good on paper.
- A wrong stock count is worse than no stock count. Hence questions instead of guessing, a “needs checking” flag, and ranges instead of fake precision.
- The agent can only work unsupervised where it can’t break anything. Unsupervised recognition only became safe once it stopped writing to the inventory directly.
- Don’t modify someone else’s program. A separate layer next to Part-DB is more work up front, but Part-DB’s own updates never break anything.
What’s left is the physical part: boxes, QR-code labels, and putting parts where the database points. The inventory has already started working for other projects, too. The camera above the soldering bench logs parts desoldered from old boards into it, and the modded component tester is meant, eventually, to suggest what a part is.
Taking parts into Part-DB from photos: a phone photo, recognition by an AI agent over MCP, approval with one tap.
View on GitHub



Leave a comment