Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
92 changes: 92 additions & 0 deletions CLAUDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,3 +41,95 @@ The project roadmap is maintained in `ROADMAP.md`. When working on features or d
- Update the roadmap when completing items (move to "Completed" section)
- Add new items as they are identified or requested
- Keep items well-organized by category (Performance, Features, etc.)

## Elroy Agent Tools (Also Available as Claude Code Skills)

Elroy provides tools that are available both to the Elroy agent directly AND as Claude Code skills (via `/` commands).

### Memory Management Tools

These tools allow creating and managing long-term memories:

- **create_memory(name, text)** - Create a new long-term memory
- Claude Code: `/remember "content"`
- Example: `create_memory("Project preferences", "User prefers TypeScript")`

- **examine_memories(query)** - Search through memories
- Claude Code: `/recall "query"`
- Example: `examine_memories("authentication method")`

- **print_memories()** - List all active memories
- Claude Code: `/list-memories`

- **create_reminder(name, text, trigger_datetime, reminder_context)** - Create a reminder
- Claude Code: `/remind "content"`
- Example: `create_reminder("Review PR", "Check the authentication PR", trigger_datetime="2025-01-26 14:00")`

- **print_active_reminders()** - List active reminders
- Claude Code: `/list-reminders`

- **ingest_doc(path)** - Ingest documents into memory
- Claude Code: `/ingest path`
- Example: `ingest_doc("docs/architecture.md")`

### Self-Improvement Tools

These tools enable Elroy to understand and improve itself:

- **introspect(query)** - Ask questions about Elroy's implementation
- Claude Code: `/introspect "query"`
- Example: `introspect("How does memory consolidation work?")`
- Returns: Detailed explanation with file paths and implementation details

- **make_improvement(description, create_branch, run_tests, submit_pr)** - Implement an improvement
- Claude Code: `/make-improvement "description"`
- Example: `make_improvement("Add date-aware search to examine_memories")`
- Workflow: Plan → Implement → Test → Document → Submit PR
- Returns: PR URL when submitted

- **review_roadmap()** - Review roadmap, issues, and recent commits
- Example: `review_roadmap()`
- Returns: Current project status and priorities

### Usage in Elroy Agent

When working as the Elroy agent (not in Claude Code), you can call these tools directly:

```python
# Understand implementation before making changes
result = introspect("How does the tool registry work?")

# Check project priorities
status = review_roadmap()

# Implement an improvement
pr_url = make_improvement(
"Add better error messages for tool failures",
create_branch=True,
run_tests=True,
submit_pr=True
)
```

### Usage in Claude Code

When working in Claude Code, use the slash command versions:

```bash
/introspect "How does memory consolidation work?"
/make-improvement "Add date-aware search"
/recall "project architecture decisions"
/remember "User prefers functional components"
```

### Development Workflow

The self-improvement tools create a complete feedback loop:

1. **Identify improvement** - Through usage patterns, user request, or review_roadmap()
2. **Understand current state** - Use introspect() to explore implementation
3. **Plan changes** - Review ROADMAP.md and issues with review_roadmap()
4. **Implement** - Use make_improvement() for structured implementation
5. **Submit for review** - PR created automatically with tests and documentation

This enables Elroy to actively participate in its own development.
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,8 @@ Elroy provides skills for [Claude Code](https://github.com/anthropics/claude-cod
- `/remind` - Create a reminder
- `/list-reminders` - List active reminders
- `/ingest` - Ingest documents into memory
- `/introspect` - Ask questions about Elroy's implementation (for development)
- `/make-improvement` - Implement a feature or improvement and submit a PR (for development)

### Installation

Expand Down
33 changes: 23 additions & 10 deletions ROADMAP.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,16 @@ This document tracks planned improvements and features for Elroy.

## Future Items

(Items will be added here as they are identified)
### Self-Improvement Framework (Partial)
Enable Elroy to actively participate in its own development:
- **Usage analytics tracking**: Capture interaction outcomes (success/failure/retry patterns)
- **Analysis tools**: Tools to query usage patterns, review roadmap
- **Improvement proposals**: System for agent to suggest and prioritize improvements based on observed data
- **Development session mode**: Special mode where agent works on implementing improvements

**Completed foundation**:
- ✅ `/introspect` skill - Agent can understand its own implementation
- ✅ `/make-improvement` skill - Agent can implement changes and submit PRs

## Completed

Expand All @@ -22,12 +31,16 @@ This document tracks planned improvements and features for Elroy.
- Configured automatic logging for slow operations (>100ms)

### Developer Experience
- **Create Claude Code skills for memory tools** (Completed: 2025-01)
- Built complete set of 6 Claude Code skills in `claude-skills/` directory
- `/remember` - Create long-term memories
- `/recall` - Search through memories
- `/list-memories` - List all active memories
- `/remind` - Create reminders
- `/list-reminders` - List active reminders
- `/ingest` - Ingest documents into memory
- Includes installation script with help documentation
- **Create Claude Code skills for memory and development tools** (Completed: 2025-01)
- Built complete set of 8 Claude Code skills in `claude-skills/` directory
- Memory management:
- `/remember` - Create long-term memories
- `/recall` - Search through memories
- `/list-memories` - List all active memories
- `/remind` - Create reminders
- `/list-reminders` - List active reminders
- `/ingest` - Ingest documents into memory
- Self-improvement capabilities:
- `/introspect` - Ask questions about Elroy's implementation (enables self-awareness)
- `/make-improvement` - Implement features/improvements and submit PRs (enables self-modification)
- Includes installation script and comprehensive documentation
24 changes: 24 additions & 0 deletions claude-skills/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ This directory contains Claude Code skills that expose Elroy's memory management

Elroy skills allow you to use Elroy's powerful memory management features directly from within Claude Code sessions. This creates a seamless integration between Claude Code and Elroy's long-term memory capabilities.

Additionally, development skills (`/introspect` and `/make-improvement`) enable Elroy to understand and improve itself - creating a self-improvement feedback loop.

## Available Skills

| Skill | Description | Usage |
Expand All @@ -16,6 +18,8 @@ Elroy skills allow you to use Elroy's powerful memory management features direct
| `/remind` | Create a reminder | `/remind "Review PR tomorrow"` |
| `/list-reminders` | List active reminders | `/list-reminders` |
| `/ingest` | Ingest documents | `/ingest docs/` |
| `/introspect` | Ask about Elroy's implementation | `/introspect "How does memory consolidation work?"` |
| `/make-improvement` | Implement and PR a feature | `/make-improvement "Add date-aware search"` |

## Installation

Expand Down Expand Up @@ -111,6 +115,26 @@ Make documentation available to Elroy for context:
/ingest specs/api-documentation.pdf
```

### Self-Improvement Workflow

Use the development skills to understand and improve Elroy:

```bash
# Understand how something works
/introspect "How does memory consolidation work?"

# Implement an improvement
/make-improvement "Add date-aware search to examine_memories"

# The agent will:
# 1. Use /introspect to understand current implementation
# 2. Plan the change and ask for approval
# 3. Implement, test, and document the change
# 4. Submit a pull request
```

This creates a complete feedback loop where Elroy can understand and improve itself.

## How It Works

Each skill is a Claude Code skill (SKILL.md file with YAML frontmatter) that:
Expand Down
16 changes: 10 additions & 6 deletions claude-skills/install-skills.sh
Original file line number Diff line number Diff line change
Expand Up @@ -35,12 +35,14 @@ OPTIONS:
--help, -h Show this help message

INSTALLED SKILLS:
/remember - Create a long-term memory
/recall - Search through memories
/list-memories - List all memories
/remind - Create a reminder
/list-reminders - List active reminders
/ingest - Ingest documents into memory
/remember - Create a long-term memory
/recall - Search through memories
/list-memories - List all memories
/remind - Create a reminder
/list-reminders - List active reminders
/ingest - Ingest documents into memory
/introspect - Ask questions about Elroy's implementation
/make-improvement - Implement a feature or improvement and submit a PR

REQUIREMENTS:
- Elroy must be installed and available in PATH
Expand Down Expand Up @@ -101,6 +103,8 @@ SKILLS=(
"remind"
"list-reminders"
"ingest"
"introspect"
"make-improvement"
)

# Uninstall if requested
Expand Down
80 changes: 80 additions & 0 deletions claude-skills/introspect/SKILL.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,80 @@
---
name: introspect
description: Ask questions about Elroy's implementation and codebase
disable-model-invocation: false
---

Ask questions about how Elroy is implemented. This skill helps you understand Elroy's codebase, architecture, and implementation details.

## Usage

When the user invokes this skill with `/introspect [QUERY]`, you should use the Task tool with the Explore agent to search through the Elroy codebase.

**IMPORTANT**: You are currently working in the Elroy repository at `/Users/tombedor/development/elroy`. Use the Task tool to explore the codebase.

### Example Task Tool Usage

```
Task tool with:
- subagent_type: "Explore"
- description: "Explore Elroy codebase"
- prompt: "<the user's query about implementation>"
- model: "sonnet" (for speed)
```

### What You Can Ask About

- **Architecture**: "How does memory consolidation work?"
- **Implementation**: "Where is the memory recall classifier implemented?"
- **Data models**: "What database tables exist?"
- **Tools**: "How are tools registered and executed?"
- **Configuration**: "What configuration options are available?"
- **Features**: "How do reminders work?"
- **Performance**: "What latency tracking exists?"

### Examples

User query: `/introspect "How does memory consolidation work?"`

You should:
1. Use the Task tool with Explore agent to search the codebase
2. Look for files related to consolidation (e.g., consolidation.py)
3. Examine relevant code
4. Provide a clear explanation of how it works

User query: `/introspect "Where is the latency tracker used?"`

You should:
1. Use Task/Explore to find latency.py and usage sites
2. Show where it's initialized and tracked
3. Explain the tracking mechanism

### Response Format

Provide:
1. **Summary**: Brief answer to the question
2. **Key Files**: List relevant file paths with line numbers
3. **How It Works**: Explanation of the implementation
4. **Related Code**: Any connected systems or patterns

### Repository Structure

The Elroy codebase is organized as:
- `elroy/core/` - Core infrastructure (logging, latency, context, tracing)
- `elroy/db/` - Database models and operations
- `elroy/repository/` - Data access layer (memories, reminders, messages)
- `elroy/tools/` - Agent tools and commands
- `elroy/messenger/` - Message processing and agent loop
- `elroy/cli/` - CLI interface
- `elroy/config/` - Configuration management
- `elroy/io/` - Input/output handling
- `claude-skills/` - Claude Code integration skills

### Notes

- Use the Explore agent for thorough searches across the codebase
- Include file paths with line numbers (e.g., `elroy/core/latency.py:45`)
- Explain not just "what" but "why" when possible
- Reference related systems and how they connect

This skill enables self-awareness - helping the agent understand its own implementation.
Loading