https://github.com/omnidotdev/agent-core
🤖 Reusable AI agent library for Omni
https://github.com/omnidotdev/agent-core
agent ai library rust
Last synced: 2 months ago
JSON representation
🤖 Reusable AI agent library for Omni
- Host: GitHub
- URL: https://github.com/omnidotdev/agent-core
- Owner: omnidotdev
- License: apache-2.0
- Created: 2026-02-12T06:44:42.000Z (4 months ago)
- Default Branch: master
- Last Pushed: 2026-03-22T06:40:40.000Z (3 months ago)
- Last Synced: 2026-04-06T03:37:18.605Z (2 months ago)
- Topics: agent, ai, library, rust
- Language: Rust
- Homepage:
- Size: 200 KB
- Stars: 1
- Watchers: 0
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE.md
Awesome Lists containing this project
README
🤖 Agent Core
[Website](https://omni.dev) | [Docs](https://docs.omni.dev) | [Feedback](https://backfeed.omni.dev/workspaces/omni) | [Discord](https://discord.gg/omnidotdev) | [X](https://x.com/omnidotdev)
**Agent Core** is a reusable Rust library for building AI agents in the [Omni](https://omni.dev) ecosystem. It provides provider-agnostic LLM integration, conversation management, a permission system, and plan file management.
## Features
- **LLM Provider Abstraction** — BYOM (Bring Your Own Model) trait with streaming completions, supporting Anthropic, OpenAI, and a unified multi-provider backend
- **Conversation Management** — Multi-turn conversation state with serialization and persistence
- **Permission System** — Configurable ask/allow/deny presets, session caching, and TUI dialog integration for agent tool use
- **Plan Management** — Plan file storage for plan mode with project-local and global directories
- **Core Types** — Messages, roles, content blocks, tool definitions, streaming events, and usage tracking
## Installation
Add to your `Cargo.toml`:
```toml
[dependencies]
agent-core = { git = "https://github.com/omnidotdev/agent-core" }
```
## Usage
### LLM Provider
Implement the `LlmProvider` trait to add support for any LLM backend:
```rust
use agent_core::provider::{CompletionRequest, CompletionStream, LlmProvider};
struct MyProvider;
#[async_trait::async_trait]
impl LlmProvider for MyProvider {
fn name(&self) -> &'static str {
"my-provider"
}
async fn stream(
&self,
request: CompletionRequest,
) -> agent_core::error::Result {
// Stream completion events from your LLM
todo!()
}
}
```
### Built-in Providers
```rust
use agent_core::providers::{AnthropicProvider, OpenAiProvider, UnifiedProvider};
```
### Conversation
```rust
use agent_core::conversation::Conversation;
let mut conv = Conversation::with_system("You are a helpful assistant.");
conv.add_user_message("Hello!");
conv.add_assistant_message("Hi there!");
// Persist to disk
conv.save(Path::new("conversation.json"))?;
```
### Permissions
```rust
use agent_core::permission::{PermissionActor, PermissionClient};
let (actor, tx) = PermissionActor::new();
let client = PermissionClient::new("session-id".into(), tx);
// Actor runs in background, client is used by tools to request permissions
tokio::spawn(actor.run());
```
## Development
```bash
cargo build # Build
cargo test # Run tests
cargo clippy # Lint
```
## Ecosystem
- **[Omni CLI](https://github.com/omnidotdev/cli)**: Agentic CLI powered by Agent Core
- **[Beacon](https://github.com/omnidotdev/beacon)**: Voice and messaging gateway powered by Agent Core
- **[Omni Terminal](https://github.com/omnidotdev/terminal)**: GPU-accelerated terminal emulator built to run everywhere
## License
The code in this repository is licensed under Apache 2.0, © [Omni LLC](https://omni.dev). See [LICENSE.md](LICENSE.md) for more information.