frontpage.
newsnewestaskshowjobs

Made with ♥ by @iamnishanth

Open Source @Github

fp.

Open in hackernews

Show HN: Pydantic-AI-stream – Structured event streaming for pydantic-AI agents

https://github.com/opale-ai/pydantic-ai-stream
6•sbargaoui•19h ago

Comments

sbargaoui•19h ago
We've been building agents with pydantic-ai in production. The framework is great for defining agents, but we kept rewriting the same infrastructure to actually show them to users.

The pattern we landed on: agent runs in a background worker, emits events to Redis Streams, frontend consumes via SSE. Multiple clients can listen to the same stream. If the user navigates away or hits stop, we delete a key and the agent aborts gracefully at the next node boundary.

pydantic-ai gives you Agent.iter() and streaming primitives, but wiring this up - structured events, reconnection, history across turns - is a lot of glue.

This library wraps iter() and handles the lifecycle:

begin → [llm-begin → part-deltas → llm-end]+ → end

Each event is typed: text delta, tool call with args, tool return, error. Frontend gets structured JSON it can render directly.

It's thin (~400 LOC) and doesn't patch pydantic-ai internals. You bring your own session storage by implementing load/save.

Feedback welcome, especially on the event protocol.

shikhar•18h ago
Very cool! Would you consider making the streaming backend pluggable? s2.dev could make a lot of sense as a serverless option, and a self-hostable OSS implementation of the API is also coming soon. S2 is great for agent session-level streams (https://s2.dev/blog/agent-sessions), and unlike Redis Streams all data is always completely durable on object storage.
sbargaoui•18h ago
Thanks! Pluggable backends are surely on the radar.

The current implementation is deliberately thin: the stream operations are just xadd/xread/set/get/delete. Abstracting that into a protocol wouldn't be hard, and a model based on stream-per-session, durable and serverless fits the use case well.

Redis was the pragmatic choice for v0 since most teams already have it running and the latency is good for real-time streaming to frontends. But durability is a valid concern, especially if the agent run matters (billing, compliance, debugging), you want it persisted properly, not just in Redis memory.

If S2's self-hostable OSS version lands soon, that'd lower the barrier for people to try it.

Would love to hear if there are other backend preferences out there !

Show HN: Executable Markdown files with Unix pipes

59•jedwhite•10h ago•48 comments

Show HN: macOS menu bar app to track Claude usage in real time

https://github.com/richhickson/claudecodeusage
138•RichHickson•18h ago•46 comments

Show HN: A geofence-based social network app 6 years in development

https://www.localvideoapp.com
65•Adrian-ChatLocl•16h ago•41 comments

Show HN: Commit-based code review instead of PR-based

https://commitguard.ai
8•moshetanzer•7h ago•0 comments

Show HN: DeepDream for Video with Temporal Consistency

https://github.com/jeremicna/deepdream-video-pytorch
61•fruitbarrel•23h ago•24 comments

Show HN: Ever wanted to look at yourself in Braille?

https://github.com/NishantJoshi00/dith
3•cat-whisperer•5h ago•0 comments

Show HN: A Wall Street Terminal for Everyone

https://marketterminal.com/chart
6•adamfontan•5h ago•4 comments

Show HN: I visualized the entire history of Citi Bike in the browser

https://bikemap.nyc/
109•freemanjiang•1d ago•31 comments

Show HN: I built a tool to create AI agents that live in iMessage

https://tryflux.ai/
28•danielsdk•5d ago•12 comments

Show HN: An all-in-one image crop/split/collage tool (no uploads, no watermark)

https://imagesplitter.tools
3•harperhuang•7h ago•6 comments

Show HN: I built a "Do not disturb" Device for my home office

https://apoorv.page/blogs/over-engineered-dnd
93•quacky_batak•5d ago•49 comments

Show HN: Watch LLMs play 21,000 hands of Poker

https://pokerbench.adfontes.io/run/Large_Models
29•jazarwil•23h ago•18 comments

Show HN: Image Scaler – Privacy-focused image resizing with 60-image batches

https://image-scaler.com/
2•nmczzi•8h ago•1 comments

Show HN: SMTP Tunnel – A SOCKS5 proxy disguised as email traffic to bypass DPI

https://github.com/x011/smtp-tunnel-proxy
136•lobito25•2d ago•44 comments

Show HN: Layoffstoday – Open database tracking for 10k Companies

https://layoffstoday.io/
2•doremon0902•9h ago•2 comments

Show HN: Claude Code for Django

https://github.com/kjnez/claude-code-django
4•cui•10h ago•2 comments

Show HN: Open database of link metadata for large-scale analysis

https://github.com/rumca-js/RSS-Link-Database-2025
15•renegat0x0•5d ago•1 comments

Show HN: Tailsnitch – A security auditor for Tailscale

https://github.com/Adversis/tailsnitch
277•thesubtlety•3d ago•28 comments

Show HN: Free and local browser tool for designing gear models for 3D printing

https://gears.dmtrkovalenko.dev
52•neogoose•2d ago•13 comments

Show HN: Fzf-navigator, a terminal file system navigator

https://github.com/benward2301/fzf-navigator
2•benward2301•11h ago•0 comments

Show HN: We built a permissions layer for Notion

https://notionportals.com/
11•PEGHIN•17h ago•6 comments

Show HN: Mantic.sh – A structural code search engine for AI agents

https://github.com/marcoaapfortes/Mantic.sh
78•marcoaapfortes•2d ago•37 comments

Show HN: DoNotNotify – Log and intelligently block notifications on Android

https://donotnotify.com/
343•awaaz•3d ago•165 comments

Show HN: Legit, Open source Git-based Version control for AI agents

5•jannesblobel•12h ago•0 comments

Show HN: VaultSandbox – Test your real MailGun/SES/etc. integration

https://vaultsandbox.com/
58•vaultsandbox•2d ago•13 comments

Show HN: 48-digit prime numbers every git commit

https://textonly.github.io/git-prime/
66•keepamovin•1w ago•54 comments

Show HN: How I generate animated pixel art with AI and Python

https://sarthakmishra.com/blog/building-animated-sprite-hero
16•sarthak_drool•1d ago•2 comments

Show HN: Prism.Tools – Free and privacy-focused developer utilities

https://blgardner.github.io/prism.tools/
371•BLGardner•3d ago•101 comments

Show HN: KeelTest – AI-driven VS Code unit test generator with bug discovery

https://keelcode.dev/keeltest
28•bulba4aur•1d ago•15 comments

Show HN: Server-rendered multiplayer games with Lua (no client code)

https://cleoselene.com/
79•brunovcosta•4d ago•59 comments