Skip to content

Latest commit

 

History

2 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

zenbrain

An AI brain that combines zenrag and zenpreference for knowledge retrieval and preference recall. Includes an MCP server and CLI.

npm

Features

  • Unified context — Combines knowledge (RAG) and preferences in one getContext call
  • MCP server — Model Context Protocol server for Cursor and other AI tools
  • CLIzenbrain for capture, query, and MCP
  • Shell history capture — Summarize and index shell history for context

Installation

bun add zenbrain

Set OPENROUTER_API_KEY in your environment for embeddings.

Usage

import { ZenBrain, createEmbeddingModel } from "zenbrain";

const embeddingModel = createEmbeddingModel(); // uses OPENROUTER_API_KEY
const brain = new ZenBrain({ embeddingModel });

// Add knowledge
await brain.addKnowledge(["Your document content here..."]);

// Store preferences
await brain.storePreference({
  key: "packageManager",
  value: "bun",
  content: "Uses bun for package management",
});

// Get combined context for a query
const context = await brain.getContext("How should I run tests?");

CLI

zenbrain capture    # Capture shell history
zenbrain query      # Query knowledge and preferences
zenbrain mcp        # Start MCP server

MCP

Add zenbrain to your MCP config (e.g. Cursor) to expose brain_retrieve, brain_get_context, brain_store_preference, and related tools.

License

MIT

About

AI brain combining RAG and semantic preferences for knowledge retrieval. MCP server, CLI, shell history capture.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages