sgr-agent-core
Core types for the sgr-agent ecosystem — the minimal shared interface that both the framework and tool crates depend on.
What's inside
| Module | Types | Purpose |
|---|---|---|
agent_tool |
Tool, ToolOutput, ToolError, ContextModifier, parse_args |
Tool trait and execution types |
context |
AgentContext, AgentState |
Shared state passed to tools |
schema |
json_schema_for, response_schema_for, make_openai_strict |
JSON Schema from Rust types |
tool |
ToolDef, tool() |
Tool definitions for LLM APIs |
When to use
- Building an agent app? Use
sgr-agent— it re-exports everything from core. - Building a tools crate? Depend on
sgr-agent-coreto avoid circular deps with sgr-agent.
Creating a tool
use ;
use JsonSchema;
use Deserialize;
;
Crate graph
sgr-agent-core (this crate) ← 5 lightweight deps
↑ ↑
sgr-agent-tools sgr-agent
(file tools) (framework)
Dependencies
Only 5 lightweight crates — no reqwest, no tokio, no LLM clients:
async-trait— async trait methodsserde+serde_json— JSON serializationschemars— JSON Schema generationthiserror— error derives