Why it matters
Spectra offers developers a flexible and performant foundation for building AI agents in both TypeScript and Rust, without the overhead of shared runtimes or FFI. Its focus on core primitives and independent SDKs allows for greater control and customization, which is crucial for developing robust and scalable AI applications.

Spectra is an open-source AI agent framework developed by codex-mohan, providing distinct SDKs for TypeScript and Rust. The project prioritizes a minimal and fast approach, aiming to offer core primitives that enable developers to build complex AI agent functionalities without framework limitations. Both the TypeScript and Rust SDKs are complete, independent native implementations, ensuring identical API surfaces and behaviors without relying on shared runtimes, bindings, or Foreign Function Interfaces (FFI).

The framework includes features such as an LLM abstraction for streaming and completion, multi-turn tool dispatch with Zod validation, hooks, and retry mechanisms. The TypeScript SDK further provides production runtime infrastructure like `SessionEngine` for lifecycle orchestration, various `SessionStore` options (in-memory, filesystem, SQLite, Redis), and distributed rate limiting with `RedisRateLimiter` and `CompositeRateLimiter`. It also features a `CircuitBreaker` for resilience and `SseBridge` for SSE streaming. The Rust SDK includes core types, agent, tools, events, and HTTP clients for various LLM providers, with a focus on zero unsafe code and `rustls` for security.

Spectra supports a range of LLM providers including Anthropic, OpenAI, and Groq, with streaming and tool use capabilities across both TypeScript and Rust implementations. The project's architecture is designed to scale from local CLI applications to distributed cloud deployments, offering different configurations for session management and rate limiting based on deployment needs. The latest release, v0.4.0, includes updates such as an npm scope migration, a new model registry supporting 158 providers and 4039 models, a mode-switching agent system, and a full rewrite of the TUI with `@opentui/react`.

Share:XHacker NewsLink
Article ID - cmpk0zqmd0