@ravenlens/raven-adk
v0.0.4
Published
AI Agents Developement Kit. For fast, smart agents developed in fraction of time of other libraries. Designed for delightful UI assemblies gorgeous UX. Made by RavenAlliance
Maintainers
Readme
RavenADK
Package is in active developement
Open source Agent Developement Kit made to support wild AI-Agents Developement initiatives. Gives native support for JavaScript environments, strongly base on events population - each action of library can be captured as the event what simplifies creating of breathtaking UX like: user see that agent is now thinking without complicated logic on side of developement. Open from definition; Anyone can become contributor.
RavenADK as default supports these SOTA Agentic patterns:
- ReAct Agent - Design for high performance with parallel tools and parallel subagents support
- RLMs - Recursive approach to increase agent accuracy on large set of text with reducing significantly costs
- Skills
- Exploring and applying
- Dynamic Skills solutions
- Scripts Execution
- Memory
- Memory exploring and writing (it does build memory about interactions)
- Memory stores:
- ChromaDB
- Expand by writing your own memory store - check tutorial
- MCP - Model context protocol is to your disposition - check it
- Events - Listen agent events and transfer this to UI/TUI to show user what your agent is doing
- HITL - sometimes actions are risky or agent needs more information and it can ask you for that - check
- Sandboxes - Secure code execution environments designed for RLM and ReAct tools - check
- Builting tools
- Browser - run serverless browser on your device - check
Installation
npm install @ravenlens/raven-adkGraphBased
Use graph with this style to make your own workflow
import { Graph, GraphMarkers } from "@ravenlens/raven-adk/graph";
const graphState = { invokeTimes: 0 };
const graph = new Graph(graphState);
// Listen events execution
graph.onEvent("node_start", (nodeId, state) => {
// When node execution has begun
});
graph.onEvent("node_end", (nodeId, state) => {
// When node was finished (after return)
});
graph.onEvent("state_change", (nodeId, stateBefore, stateAfter) => {
// When state was changed before node execution
});
// Graph Src logic
graph
.addNode("node_1", (graphState) => {
/// your logic
if (invokeTimes === 1) {
return {}; // Empty object when no state nor node was updated -> then will be called node introduced by the edge
}
return {
stateUpdate: {
...graphState,
invokeTimes: graphState.invokeTimes + 1
},
// Overrides node calling logic -> can call different node with this
callNode: "node_1"
}
})
.addNode("node_2", async (graphState) => {
/// your logic
return {
stateUpdate: {
...graphState,
invokeTimes: graphState.invokeTimes + 1
}
}
})
.addEdge(GraphMarkers.START, "node_1")
.addEdge("node_1", "node_2")
.addEdge("node_2", GraphMarkers.END);
// Start graph execution
await graph.start();
// Returns your updated state via all nodes execution
const updatedState = graph.getState(); // OR: graph.graphState;Agent
ReAct Agent
ReAct Agent is the standalone agent of RavenADK -> it's about to Reason atop of given task and act in his behalf to accomplish given task The best as possible.
ReAct agent will: Reason, Make Actions, Use tools, Produce Thoughts and at the end produce output.
import { ReActAgent } from "@ravenlens/raven-adk/agents";
import { OpenAI } from "@ravenlens/raven-adk/models";
const reactAgent = new ReActAgent({
model: new OpenAI({
model: "gpt-4",
apiKey: "your-api-key",
}),
systemPrompt: "Your system prompt",
messages: [{ type: "user", content: "Hello!" }],
tools: []
});
const agentSync = await reactAgent.invoke();
console.log(agentSync.messages.at(-1).content);RLM (Recurrent Language Models)
RLM is a powerful pattern for processing massive datasets (100MB+) and complex analyses through recursive delegation to specialized models. It implements the CodeAct pattern where an orchestrator LLM writes and executes code to explore data, delegating analysis tasks to cheaper sub-models when needed.
Why RLM?
- Process huge datasets without context window limitations
- Reduce costs by 70-90% through smart model delegation
- Faster execution via iterative code-based exploration
- Transparent reasoning via code execution events
import { RLMAgent } from "@ravenlens/raven-adk/rlm";
import { NodeExecutionSandbox } from "@ravenlens/raven-adk/sandboxes";
import { OpenAI } from "@ravenlens/raven-adk/models";
// Load massive dataset (e.g., 500MB log file)
const largeDataset = await fs.readFile("./massive-data.txt", "utf-8");
const rlmAgent = new RLMAgent(largeDataset, {
model: new OpenAI({
model: "gpt-4o", // Orchestrator: writes code to explore data
apiKey: process.env.OPENAI_API_KEY
}),
submodels: [
{
model: new OpenAI({
model: "gpt-3.5-turbo", // Sub-model: fast & cheap
apiKey: process.env.OPENAI_API_KEY
}),
instruction: "Analyze patterns and classify data"
}
],
maxIterations: 5,
codeSandbox: new NodeExecutionSandbox()
});
// Monitor the reasoning process
rlmAgent.onEvent("orchestrator_model_call", (model, result) => {
console.log("🧠 Orchestrator code:", result.substring(0, 100) + "...");
});
rlmAgent.onEvent("submodel_call", (model, task) => {
console.log("🤖 Delegating to sub-model:", task.substring(0, 80) + "...");
});
// Run analysis
const result = await rlmAgent.invoke(
"Analyze logs: find top 5 error types, frequency trends, and performance bottlenecks"
);
console.log("✅ Analysis:", result);
console.log("📊 Tokens used:", rlmAgent.getUsage());Combine RLM + ReAct for Complex Workflows:
// Step 1: RLM processes huge dataset efficiently
const rlmAnalysis = await rlmAgent.invoke("Extract key findings from 500K records");
// Step 2: ReAct Agent acts on findings (uses tools, makes decisions)
const reactAgent = new ReActAgent({
model: new OpenAI({ model: "gpt-4o", apiKey: process.env.OPENAI_API_KEY }),
systemPrompt: "You are an operations agent.",
messages: [
{
type: "user",
content: `Based on this analysis:\n${rlmAnalysis}\n\nCreate alerts and notify teams.`
}
],
tools: [
{
name: "create_alert",
description: "Create a system alert",
execute: async (params) => createAlert(params)
}
]
});
await reactAgent.invoke();Use Cases:
- 📊 Log Analysis: Find errors & anomalies in GB-sized logs
- 🔍 Search Results Processing: Filter 10K+ results down to top insights
- 📄 Document Review: Assess contracts, policies, PDFs at scale
- 👥 Data Segmentation: Classify millions of records efficiently
- 🏦 Compliance Checks: Scan large datasets for violations
Read full RLM documentation with case studies • CodeAct Pattern
Combine RLM with ReAct agent for the best performance gains start here
Skills
Skills of RavenADK are compliant with open skills standard what is use by e.g: Claude Code, MS Copilot and likelly more Read more about RavenADK skills. Additional skill features:
- Agent can execute skill scripts
- Skills can be downloaded from outside of the Agent - from some skill hub (beware of malicious scripts within some community skills)
- Agent can automatically create new skills if option is turn on
Documentation
Contribution
If you would like to become official contributor contact with one of bellow channels
Your ideas are going to be appreciated
You can openly tell your your idea in the issues or in the one of above specified channels
