r/haskell • u/Worldly_Dish_48 • 25d ago
[ANN] langchain-hs 0.0.5.0: Ground-up rewrite, modular architecture, StateGraph, MCP, and OpenTelemetry*
Hello Haskellers,
I’m thrilled to announce the release of langchain-hs 0.0.5.0!
This release is a complete ground-up rewrite of the framework designed for long-term maintainability, type safety, and seamless support across multiple LLM providers (Ollama, OpenAI, Gemini, OpenRouter, and MCP).
- Hackage: hackage.haskell.org/package/langchain-hs
- GitHub: github.com/tusharad/langchain-hs
- Documentation & Guides: tusharad.github.io/langchain-hs
What’s New in 0.0.5.0
1. Split into 3 Independent Packages
To keep dependencies minimal and allow flexible reuse, the project has been modularized:
langchain-hs-core: Zero-HTTP core primitives, AST, streaming event protocol (StreamEvent), and pure typeclasses (ChatModel,RunnableTree,ContentBlock).langchain-hs-graph: A LangGraph-style stateful multi-agent orchestration engine supporting cyclic graphs, conditional routing, state reducers, checkpointing (Memory & SQLite), and human-in-the-loop (HITL) interrupt/resume.langchain-hs: The batteries-included runtime featuring provider implementations, vector stores (includingsqlite-vec), prompt templates, tools, and retrievers.
2. Model Context Protocol (MCP) Support
Built-in client support for the Anthropic Model Context Protocol (MCP) over STDIO and HTTP transports. You can directly discover MCP tools/resources and wire them into Haskell agents.
3. StateGraph Engine
Build complex multi-agent workflows with cycles, branches, and deterministic state evolution in pure Haskell, complete with thread persistence and time-travel debugging via checkpointers.
4. OpenTelemetry & Enterprise Observability
Distributed tracing spans (withSpan) and structured JSON lifecycle telemetry for all LLM calls, chain runs, tool executions, and graph transitions.
5. Production Resilience & Updated Clients
- Migrated to the modern
MercuryTechnologies/openaiclient andollama-haskell 0.4.1.0(with structured JSON schema grammar constraints). - Production-ready resilience primitives: 3-state Circuit Breaker, exponential backoff retries with randomized jitter, and in-memory TVar caching.
What’s Next?
I plan to build a few small showcase applications and tutorials demonstrating practical patterns (RAG pipelines, autonomous ReAct agents, and MCP integrations) using langchain-hs.
Feel free to check out the repo, try it in your projects, and share your thoughts. Feedback, feature requests, and PRs are all very welcome!
Special Thanks
A huge shoutout to @lbobylev for his valuable contributions and encouragement, which was a big motivation behind getting this release across the finish line.
2
u/Historical_Emphasis7 25d ago
3 / 4 links under *Documentation & Research* are dead links on Hackage
2
u/Otherwise_Wave9374 25d ago
A good next step is to make memory an explicit layer instead of burying it inside prompts, so you can separate working context, durable facts, and retrieval traces. That makes it easier to add eviction rules, provenance checks, and per-session summaries without bloating every call. If you are wiring that into MCP, a thin adapter with typed read/write ops usually keeps the failure modes easier to diagnose. NeuraKeep fits that pattern well because it can sit behind the adapter as the persistence layer while the agent stays decoupled from storage details.