Rene's Agentic System for Everything β A lightweight, extensible AI agent framework in pure Java.
RASE1 powers autonomous AI agents that can hold conversations, execute tools, manage memory, and interact with the real world β all from a single JAR. Built with minimal dependencies. Just Java 21 and reactive streams.
RASE1 is the engine behind Slick β a personal AI agent that lives on a Raspberry Pi, manages calendars, shopping lists, train schedules, code reviews, and more. But the core is generic: plug in any LLM provider, define your tools, and you've got an agent.
Think of it as a headless AI agent runtime β a tight loop of LLM calls and tool executions, with streaming, memory, sessions, and security baked in.
βββββββββββββββββββββββββββββββββββββββββββββββ
β Gateway β
β (Discord, CLI, ...) β
ββββββββββββββββββββ¬βββββββββββββββββββββββββββ
β
ββββββββββββββββββββΌβββββββββββββββββββββββββββ
β Agent β
β ββββββββββββββββββββββββββββββββββββββββββ β
β β AgentLoop β β
β β LLM Call β Parse β Tool Exec β Loop β β
β ββββββββββββββββββββββββββββββββββββββββββ β
β ββββββββββββ ββββββββββββ ββββββββββββββ β
β β Sessions β β Memory β β Scheduling β β
β ββββββββββββ ββββββββββββ ββββββββββββββ β
ββββββββββββββββββββ¬βββββββββββββββββββββββββββ
β
ββββββββββββββββββββΌβββββββββββββββββββββββββββ
β Tools β
β Built-in: bash, grep, find, ls, edit, ... β
β Script: Any .sh/.py with a manifest β
β Custom: Implement AgentTool<T> β
βββββββββββββββββββββββββββββββββββββββββββββββ
β
ββββββββββββββββββββΌβββββββββββββββββββββββββββ
β LLM Providers β
β Anthropic β OpenAI β Google (via Replicate)β
βββββββββββββββββββββββββββββββββββββββββββββββ
- Agentic Loop β Multi-turn LLM β tool execution loop with configurable depth limits
- Streaming β Reactive (Project Reactor) streaming of LLM responses and agent events
- Multi-Provider β Supports Anthropic (Claude), OpenAI (GPT), and Google (Gemini) API formats, routed through Replicate
- Built-in Tools β
bash,grep,find,ls,edit,write,codex(delegate to a coding sub-agent) - Script Tools β Drop a shell/Python script with a YAML manifest and it becomes a tool automatically
- Command Security β Allowlist/blocklist-based shell command policy. The agent can only run what you permit
- Semantic Memory β SQLite-backed long-term memory with embedding-based semantic search
- Session Management β Persistent conversation sessions with transcript generation
- Scheduling β Cron and one-shot scheduled prompts that fire autonomously
- Discord Gateway β First-class Discord bot integration with streaming message updates, attachments, voice note transcription
- Docker Hardened β Runs in a capability-dropped, no-port, no-privilege-escalation container
| Component | Technology |
|---|---|
| Language | Java 21 |
| Reactive Streams | Project Reactor |
| JSON | Jackson |
| Database | SQLite (via sqlite-jdbc) |
| Embeddings | Replicate (multilingual-e5-large) |
| CLI | JLine 3 |
| Build | Maven |
| Container | Docker |
| Target Hardware | Raspberry Pi 4 (but runs anywhere) |
src/main/java/com/renemrhfr/rase1/
βββ agent/ # Core agent loop, state, events, config
β βββ events/ # AgentEvent types (start, text delta, tool exec, ...)
β βββ messages/ # Message types (user, assistant, tool result, reminder)
β βββ tools/ # AgentTool interface and schema generation
βββ bootstrap/ # Application launcher
βββ discord/ # Discord gateway (bot integration)
βββ llm/ # LLM abstraction, model catalog, streaming events
β βββ providers/ # LlmProvider implementations (Replicate)
β βββ streaming/ # SSE event parsing and delta types
β βββ context/ # Conversation context for API calls
βββ memory/ # Semantic memory (embeddings, SQLite, search)
βββ schedule/ # Cron and one-shot task scheduling
βββ session/ # Conversation persistence and transcripts
βββ tools/ # Tool implementations
βββ builtin/ # Bash, Grep, Find, Ls, Edit, Write, Codex
βββ script/ # Script-based tool loader (auto-discovery)
βββ shell/ # Process execution engine
βββ security/ # Command allowlist/blocklist policy
βββ replicate/ # Replicate API client for model calls
βββ path/ # Path resolution utilities
βββ truncation/ # Output truncation for large tool results
Tools that ship with the engine:
| Tool | Description |
|---|---|
bash |
Execute shell commands (subject to allowlist policy) |
write |
Write content to files |
edit |
Match-and-replace text editing |
grep |
Regex search across files |
find |
Glob-based file discovery |
ls |
Directory listing |
manual |
Load full tool documentation |
codex |
Delegate complex coding tasks to a sub-agent |
Drop a script + manifest into your tools directory and it's automatically registered:
tools/
βββ my-tool/
βββ my-tool.sh # or my-tool.py
βββ my-tool.md # YAML front-matter manifest
The manifest defines the tool's name, description, parameters, and examples. The agent passes parameters as JSON on stdin, and reads stdout as the result.
Implement AgentTool<T> for full control:
public interface AgentTool<T> {
String name();
String description();
List<String> examples();
CompletableFuture<AgentToolResult> execute(T parameters, CancellationToken token);
}The agent's shell access is governed by policy files:
- Allowlist β Only commands matching these rules can execute
- Blocklist β Override allowlist for specific dangerous commands
Rule types:
command:git # Allow/block by first token
prefix:cat /app/ # Allow/block by prefix match
exact:ls -la # Allow/block exact command
tool:my-tool # Allow/block a script tool by name
If no allowlist is configured, all commands are blocked by default.
- Java 21+
- Maven
- Docker (for containerized deployment)
- A Replicate API token (for LLM access)
mvn clean package -DskipTests# Configure your .env file with required API tokens
docker compose up --build| Variable | Description |
|---|---|
REPLICATE_API_TOKEN |
Replicate API token for LLM and embedding calls |
DISCORD_TOKEN |
Discord bot token (for Discord gateway) |
RASE1_TOOLS_DIR |
Directory to scan for script tools |
RASE1_ALLOWED_COMMANDS_FILE |
Path to command allowlist |
RASE1_BLOCKED_COMMANDS_FILE |
Path to command blocklist |
TZ |
Timezone (e.g. Europe/Vienna) |
The agent can trigger its own rebuild by writing a file to a mounted volume. A host-side watcher picks it up, builds the jar, and restarts the container.
Agent writes REBUILD_REQUESTED β host watcher detects it β mvn package β docker compose build β up -d
If the new container fails to start, the watcher rolls back to the previous jar automatically.
- Java 21 JDK:
sudo apt install openjdk-21-jdk - Maven:
sudo apt install maven - Docker + Docker Compose
- Copy the watcher script to your project root and make it executable:
cp watch-rebuild.sh ~/rase1-agent/
chmod +x ~/rase1-agent/watch-rebuild.sh-
Edit the CONFIG section at the top of
watch-rebuild.shto match your paths and jar name. -
Install the systemd service:
sudo cp rase-rebuild-watcher.service /etc/systemd/system/
sudo systemctl daemon-reload
sudo systemctl enable rase-rebuild-watcher
sudo systemctl start rase-rebuild-watcherMake sure User, WorkingDirectory, and ExecStart in the service file match your setup.
- Permissions β the watcher runs as your host user but the container writes as
agentuser(UID 100, GID 101). Ensure the WATCHER directory is writable by both:
sudo groupadd -g 101 agentgroup # skip if GID 101 already exists
sudo usermod -aG agentgroup $USER
sudo chgrp -R agentgroup ./data/workspace/rase1/
sudo chmod -R g+rwX ./data/workspace/rase1/echo "manual test" > ./data/workspace/rase1/WATCHER/REBUILD_REQUESTED
journalctl -u rase-rebuild-watcher -fFiles.writeString(Path.of("/app/data/workspace/rase1/WATCHER/REBUILD_REQUESTED"), "reason for rebuild");- Watcher journal:
journalctl -u rase-rebuild-watcher -f - Build log:
logs/rebuild.log - Rebuild result:
data/workspace/rase1/WATCHER/REBUILD_STATUS
- No frameworks. No Spring, no Quarkus, no magic. Just Java and libraries.
- Reactive by default. The agent loop, LLM streaming, and event distribution all use Project Reactor.
- Security first. Shell access is allowlisted. Containers are hardened. No ports exposed.
- Extensible. Add tools via scripts or Java. Swap LLM providers. Plug in new gateways.
- Runs on a Pi. Designed to be lightweight enough for a Raspberry Pi 4, powerful enough for real work.
- @renemrhfr β Creator & Lead Developer
- @SlickTheFrog β Agent-in-Residence πΈ
TBD
Built with caffeine and curiosity. Maintained by a human and his frog. πΈ