Named Lemon as a play on "LLM". Hopefully not a "lemon" π
This repository contains Lemon, a powerful AI programming assistant designed to help developers with various tasks using natural language interactions. The core functionality is implemented in utils/lemon.js, which serves as the workhorse of this project.
The main purpose of this repository is to provide a flexible and extensible AI assistant that can:
- Understand and respond to user queries about programming tasks
- Perform file operations, code analysis, and version control actions
- Maintain a memory of important information
- Execute a wide range of tools and functions based on user input
This file is the heart of the Lemon assistant. It contains the following main components:
callLemon: A function that interacts with the Anthropic API to generate responses using the Claude model.handleLemonToolCall: A function that processes tool calls made by the AI and executes the corresponding actions.agent: The main function that orchestrates the conversation flow, tool execution, and recursive calling when necessary.- A comprehensive set of tools that Lemon can use to perform various tasks, including:
- File operations (read, write, edit, remove)
- Directory listing and creation
- Git operations (diff, add, commit)
- Grep functionality
- Memory management (read and write)
The specs/ folder contains important specifications and guidelines for the Lemon assistant:
call_llm_function.md: Likely contains specifications on how to interact with the language model API.make_sure_to_call_tool_functions.md: Provides guidelines on ensuring proper tool function calls by the AI assistant.max_name.txt: A file potentially containing a user's name or other configuration information.
- The user provides a query or task description.
- Lemon processes the input using the Claude model via the Anthropic API.
- Based on the AI's response, Lemon may execute one or more tool functions to perform specific actions.
- The results of these actions are fed back into the AI for further processing or to generate a final response.
- This process can repeat recursively if needed to complete complex tasks.
- Natural language understanding and generation
- File and directory management
- Code analysis and search capabilities
- Git integration for version control tasks
- Persistent memory for maintaining context across sessions
- Extensible tool system for adding new functionalities
To use Lemon, ensure you have the necessary dependencies installed and set up the required environment variables, particularly the Anthropic API key. Run the script with your query as a command-line argument:
node utils/lemon.js "Your query here"
Lemon is a powerful AI programming assistant that combines natural language processing with a wide range of practical tools to help developers with their day-to-day tasks. Its flexible architecture allows for easy extension and customization to suit various development needs.# Lemon: A Flexible AI Assistant for Development Tasks
This repository contains a powerful AI assistant named Lemon, designed to help with various development tasks. The core functionality is implemented in utils/lemon.js, which serves as the workhorse of this project.
- AI-Powered Assistance: Lemon uses the Anthropic API to provide intelligent responses and perform tasks.
- Tool Integration: The assistant can use a variety of tools to interact with the file system, perform git operations, and more.
- Memory Functionality: Lemon can remember important information across conversations.
- Flexible Tool Calls: The system can handle multiple tool calls and wait for their completion before responding.
The main components of the system are:
callLemon: This function interfaces with the Anthropic API to generate responses based on the given prompts and messages.handleLemonToolCall: This function processes tool calls made by the AI and executes the corresponding actions.agent: This function manages the conversation flow, including handling tool calls and maintaining context.
Lemon has access to various tools, including:
- File operations (read, write, edit, check existence)
- Directory listing
- File summarization
- Grep functionality
- Git operations (diff, add, commit)
- Memory read/write
Based on the specs provided in the specs/ folder, this project aims to:
- Enhance development workflows by providing an AI assistant that can interact with the local development environment.
- Implement a system for calling LLM functions and ensuring proper tool usage (as indicated by
call_llm_function.mdandmake_sure_to_call_tool_functions.md).
To use Lemon in your project:
- Ensure you have the necessary dependencies installed (Anthropic SDK, fs, child_process).
- Set up your Anthropic API key in the environment variables.
- Import the
agentfunction fromutils/lemon.jsin your main application file. - Call the
agentfunction with appropriate system prompts, messages, and tool configurations.
Lemon is a versatile AI assistant that can significantly improve development productivity by automating various tasks and providing intelligent assistance. Its integration with file system operations and git makes it particularly useful for software development workflows.# Lemon: An AI-powered Programming Assistant
This repository contains Lemon, an AI-powered programming assistant built using the Anthropic API. The main functionality is implemented in utils/lemon.js, which serves as the workhorse of this project.
The purpose of this repository is to create an intelligent programming assistant that can:
- Answer user questions
- Perform programming tasks
- Interact with the file system
- Execute git commands
- Maintain a memory of important information
The utils/lemon.js file is the core of this project and implements the following key features:
- AI Model Integration: Uses the Anthropic API to interact with the Claude AI model.
- Tool Execution: Implements a set of tools that allow the AI to interact with the file system, execute commands, and perform various tasks.
- Memory Management: Maintains a persistent memory that can be read and written to.
- Error Handling and Retries: Implements a retry mechanism for API calls to handle temporary failures.
- Git Integration: Provides tools for interacting with git, including viewing diffs, adding files, and committing changes.
Lemon has access to various tools, including:
- File operations (read, write, edit, remove)
- Directory listing
- File summarization
- Pattern searching (grep)
- Memory read/write
- Git operations (diff, add, commit)
- The
callLemonfunction sends requests to the Anthropic API with a system prompt, user messages, and available tools. - The AI generates responses and may call tools to perform actions or gather information.
- The
handleLemonToolCallfunction processes the tool calls and executes them. - The
agentfunction manages the conversation flow, including handling tool call results and continuing the conversation.
To use Lemon, run the script with a command or question as an argument. For example:
node utils/lemon.js "What files are in the current directory?"
Lemon will process the request, use the necessary tools, and provide a response based on the AI's understanding and the results of any tool calls.
The specs/ folder contains additional information about the project's requirements and functionality:
call_llm_function.md: Likely contains specifications for how to interact with the AI model.make_sure_to_call_tool_functions.md: Probably includes guidelines on ensuring proper tool function calls.max_name.txt: May contain a specific configuration or user information.
For more detailed information on the project's specifications, please refer to the individual files in the specs/ folder.
To contribute to this project, please review the specifications in the specs/ folder and ensure that any changes or additions align with the project's goals and requirements.
[Insert appropriate license information here]