Skip to content

tichopad/robo-mom

Repository files navigation

Robo Mom

World's lamest AI notes assistant!

Robo Mom is a CLI application that lets you chat with your Markdown notes using AI. It uses RAG to search your notes and provide relevant responses based on your personal knowledge base.

Quick Start

Prerequisites

  • Node.js (latest version)
  • pnpm package manager
  • Gemini API key

Installation

  1. Clone the repository:

    git clone <repository-url>
    cd robo-mom
  2. Install dependencies:

    pnpm install
  3. Create a .env file with your Gemini API key:

    GOOGLE_GENERATIVE_AI_API_KEY=your_gemini_api_key_here

Usage

1. Load your notes

First, index your Markdown notes into the database:

# Load all Markdown files from a directory
pnpm run cli load-files "path/to/your/notes/**/*.md"

# Example: Load example notes
pnpm run cli load-files "example_notes/**/*.md"

2. Start chatting

Start an interactive chat session:

pnpm run cli chat

In the chat interface:

  • Type your questions and press Enter to send
  • Type /exit to quit the application
  • Type /new to start a new conversation

Development

Tech stack

  • Node.js with TypeScript
  • citty for command-line interface
  • ink (React for CLI) with streaming text
  • Vercel AI SDK with Gemini integration
  • PGlite (file-based PostgreSQL) with Drizzle ORM
  • Vector search with pgvector using a local embeddings model via Transformers.js

Project structure

src/
├── cli.ts                 # Main CLI entry point
├── app.tsx               # React app for chat interface
├── commands/             # CLI command definitions
├── db/                  # Database layer
├── dev-tools/           # Development utilities
│   ├── db-cli.ts        # SQL query interface
│   ├── rag-cli.ts       # RAG testing tool
│   └── ripgrep-cli.ts   # Ripgrep testing tool
├── ui/                  # React components

Database Schema

The app uses a single notes table with the following structure defined in db/schema.ts.

Development tools

The project includes several development tools to help with debugging and testing:

Database CLI (pnpm run db:cli)

Execute SQL queries against the local database:

# Execute a single query
pnpm run db:cli --query "SELECT * FROM notes LIMIT 5"

# Interactive SQL shell
pnpm run db:cli --interactive

# Save results to file
pnpm run db:cli --query "SELECT * FROM notes" --output results.json

Drizzle Studio (pnpm run db:studio)

Launch Drizzle Studio for visual database management:

pnpm run db:studio

Vector search testing (pnpm run rag:cli)

Test the retrieval-augmented generation system:

# Basic search
pnpm run rag:cli "project ideas"

# With limit and verbose output
pnpm run rag:cli "meeting notes" --limit 5 --verbose

Ripgrep testing (pnpm run ripgrep:cli)

Test text-based search functionality:

# Basic pattern search
pnpm run ripgrep:cli "TODO"

# Case-insensitive search
pnpm run ripgrep:cli "todo" --flags "-i"

# Word boundary search with limit
pnpm run ripgrep:cli "test" --flags "-w" --limit 10

Available Scripts

  • pnpm run cli: Run the main CLI application
  • pnpm run db:migrate: Generate and run database migrations
  • pnpm run db:studio: Launch Drizzle Studio
  • pnpm run db:cli: Database query interface
  • pnpm run rag:cli: RAG testing tool
  • pnpm run ripgrep:cli: Ripgrep testing tool
  • pnpm run check: Run code quality checks (Biome + TS)

Development Workflow

  1. Run pnpm run db:migrate to set up the database
  2. Use pnpm run cli load-files to index your notes
  3. Use pnpm run rag:cli to test document retrieval
  4. Use pnpm run ripgrep:cli to test text search
  5. Use pnpm run db:cli or pnpm run db:studio for database queries
  6. Use pnpm run cli chat to test the full application

Contributing

  1. Fork the repository
  2. Create a feature branch
  3. Make your changes
  4. Run pnpm run check to ensure code quality
  5. Submit a pull request

License

This project is licensed under the Unlicense. Do whatever you want with it. I don't give a flying fuck.

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors