https://github.com/shipclojure/simulflow - Build realtime voice-enabled AI agents - v0.1.7-alpha released with new features:
Added
• Voice Activity Detection protocols that the transport-in processors can use. https://github.com/shipclojure/simulflow/blob/0.1.7-alpha/src/simulflow/vad/core.clj
• https://github.com/shipclojure/simulflow/blob/0.1.7-alpha/src/simulflow/vad/silero.clj running through Onnx Runtime
• parameter :vad/analyser to all transport-in processor params to pass a VAD analyser like Silero to be ran on each new audio chunk. This is useful for logic that handles AI interruptions and improves conversation turn-taking.
• Added malli schema for audio-output-raw frames
• Added simulflow.frame/send helper function that outputs frames based on their appropriate direction - used now in most processors.
• Twilio Integration: Twilio serializer with make-twilio-serializer for WebSocket communication
• Audio Resampler Processor: New processor for real-time sample rate conversion
• System Frame Router: New system-frame-router processor for handling system message routing in complex flows
• Interruption Support: New frame types for bot interruption handling: control-interrupt-start, control-interrupt-stop, bot-interrupt
Changed
• Made 16kHz signed PCM mono audio be the default audio that runs through the pipeline. All audio-input-raw frames that come through pe pipeline are expected to be this way.
• POTENTIAL BREAKING frame/audio-output-raw are now expected to contain the sample-rate of the audio. The sample rate will be used for chunking and final output conversion. If you have custom Text to speech generators, you need to update them to use it.
• Changed examples to use silero vad model for VAD instead of relying on Deepgram
• BREAKING Processors that outputted system-frames (see https://github.com/shipclojure/simulflow/blob/0.1.7-alpha/src/simulflow/frame.clj set for a list of system frames) will output them exclusively on :sys-out channel and normal frames on :out channel.
• Audio Processing: Enhanced audio conversion with improved µ-law/PCM support and step-by-step conversion planning
Fixed
• Audio Conversion: Fixed critical bug in PCM 16kHz to Twilio µ-law 8kHz conversion where downsampling must occur before encoding conversion
• Transport: Removed duplicate system frame passthrough that was causing duplicate frames
Hello, I built a pure (native) Clojure HNSW implementation that's competitive with (and often beats) Python's hnswlib! 📊 Benchmark results on 31K vectors (768-dim): - Clojure: 4,719 QPS vs hnswlib: 1,330 QPS (3.5x faster!) - Clojure: 0.212ms latency vs hnswlib: 0.85ms (on same parameters, and vectors) - True parallelism: 5.7x scaling vs Python's 1.3x (GIL limited) The only trade-off: hnswlib builds indices faster (C++ backend), but for production serving, pure Clojure actually outperforms the popular Python library! Still WIP but core is solid. Testing in production soon. https://github.com/damesek/hnsw-clj
Very cool. Why is building in particular faster with Python?
Ooh, nice catch! 😅 Maybe this is my mistake - sometimes I got similar build times, but when I ran a longer stress test (15 min), I got these numbers. Could be the test was flawed or something. It's still pre-alpha, but that's my story and I'm sticking to it 🙂
it might be good to link to what that acronym means, or other information about it generally
Sure, good idea! i will add to repo too. Here is the original HNSW research paper so people can learn more about it: https://arxiv.org/abs/1603.09320 — thanks for pointing this out! HNSW (Hierarchical Navigable Small World) is a high-performance graph-based algorithm for fast approximate nearest neighbor search in large vector datasets. Several libraries implement it, including hnswlib (Python/C++), nmslib, the HNSW module in FAISS, and Java versions like Jelmerk/hnswlib or the one in deeplearning4j. We use eg. at RAG. But I add more info to repo.
Ah, I should have guessed, it’s not Python, it’s a veneer of Python over C++. Perhaps better single threaded performance in C++ is to be expected. Could building with hnswlib theoretically be brought into Clojure via FFI?
this project is fully Clojure/Java, not a Python veneer over C++. I’m not using hnswlib. I re-created from research document. FFI/JNI would be possible in theory, but my goal here is a pure JVM implementation I can modify and integrate easily.
Sure, I understand. I meant that hnswlib is Python/C++, not your lib. But given the “optimal hybrid approach”, that’s the same as calling out to C++ for building, just with more steps.
Interesting stuff! The readme has a few broken links near the bottom (comparison and performance analysis).
It seems like most of the speedup is due to parallelism. In python, you can achieve parallelism for cases without much shared state by using multiple processes. Would there be a performance benefit in that case?
I've been using various wrappers for https://github.com/unum-cloud/usearch: • https://github.com/phronmophobic/usearch.clj?tab=readme-ov-file • datalevin's https://cljdoc.org/d/datalevin/datalevin/0.9.22/doc/vector-database I think they also have a java wrapper, but I haven't used it. I think a big win for pure clojure implementation is that it can greatly simplify dependencies.
@smith.adriane This is just the initial version. Single-thread performance is down to 1–1.5 ms per query, and with parallelism it drops to around 0.2 ms. GPU support could also be integrated in the future. I think the biggest advantage of this approach is that it’s fully customizable—you can modify it however you want. You can achieve performance close to Python/C++, which is more than enough to make this repository practical and effective. Ofc that isnt perfect in current state, I cutted from a bigger project (broken links.. True.. I check it, Sorry!)
https://github.com/weavejester/integrant 1.0.0-RC1 has just been released. Integrant is a micro-framework for building applications with data-driven architecture. This release is identical to 0.13.1, but with the deprecated prep and prep-key functions removed.
Link to http://arachne-framework.org/ seems to be dead as well
FYI the link to the "Enter Integrant" presentation seems to be dead.
Yes, I should probably remove that link.
Done.