# Lealone: a Java database that grew an LLM agent

> Lealone is a Java RDBMS whose README now pitches it as a self-evolving agent that turns plain SQL into services and workflows. The database half is documented; the agent half is where the questions start.

**lealone/Lealone** — 能安全适用于氛围编程和企业应用的全栈自进化通用智能体

- Repository: https://github.com/lealone/Lealone
- Stars: 2,589 · Forks: 524
- Language: Java
- License: NOASSERTION
- Published: 2026-09-10 · Updated: 2026-09-10 · Language: en
- Canonical page: https://hysenlabs.com/projects/lealone-lealone

## What problem Lealone claims to solve

The README opens with a large claim: Lealone is a high-performance full-stack self-evolving general-purpose agent that overturns the existing application development model and suits vibe coding and enterprise applications of any size. That is the pitch. The repository itself is a Java project with modules named lealone-db, lealone-sql, lealone-orm, lealone-server, lealone-client, lealone-http, lealone-net, lealone-service and lealone-agent. So the concrete problem is narrower than the marketing: you have a relational engine, a SQL layer, an ORM, a client and server, an HTTP endpoint, and an agent that sits on top of them.

The intended user is a Java developer who would rather write SQL than Java. The README's examples create a service, call it, and get an HTTP route without writing a controller, a DTO, or a build step. That is the actual value proposition. The agent is the part that generates code from a sentence like "implement a todo app". Everything else is a database with a service layer bolted to it.

## How the pieces fit together

The module list is the architecture. lealone-db and lealone-sql handle storage and query execution. lealone-orm maps rows to objects. lealone-net and lealone-client provide the wire protocol, and lealone-http exposes services over HTTP on port 8080, which the README's example URLs confirm: http://localhost:8080/service/my_service/hello?name=zhh. lealone-service is where the create service and create workflow statements live. lealone-agent is the LLM-facing layer.

The data flow described in the README is: you write SQL that declares a service, the engine registers it, and it becomes callable both from the agent window and over HTTP. A workflow is declared the same way but with a natural-language comment instead of a body, for example comment '找到指定的用户，然后跟他打招呼，把当前时间告诉他'. That comment is the specification; the agent is expected to turn it into executable steps. Nothing in the README explains how that translation is validated, retried, or bounded.

## Building and starting Lealone from source

The README gives one build command and one runtime requirement. JDK 21 or newer is required to compile and run. The build is Maven:

```bash
mvn assembly:assembly -Dmaven.test.skip=true
```

Note the skip flag: the documented build does not run tests. If you want them, you have to remove that flag yourself.

The README also points at a prebuilt lealone-8.0.0-SNAPSHOT.jar hosted on the project's GitHub Pages site, so you can skip the build. The repository's most recent tagged release, however, is lealone-6.0.1 from 2024-08-18. The jar the README tells you to run is a SNAPSHOT two major versions ahead of the last tag. That gap is worth noticing before you put it in a deployment pipeline.

Starting the server is a single command:

```bash
java -jar lealone-8.0.0-SNAPSHOT.jar
```

To open the agent instead, add the flag:

```bash
java -jar lealone-8.0.0-SNAPSHOT.jar -agent
```

The README does not document a port flag, a data directory flag, or a config file. Port 8080 appears only in example URLs.

## Configuring the model and creating your first service

The agent needs an LLM before it can do anything. The README says to run this once, inside the agent window:

```sql
set llm (
    provider: 'doubao',
    model: 'doubao-seed-2-0-pro-260215',
    api_key: 'replace-with-your-apikey'
);
```

The README states that doubao and deepseek are the supported providers. The api_key is pasted in plain text into the agent window. There is no mention of an environment variable, a keystore, or a config file, so treat the key as something that lives in your shell history and your session.

With the model configured, the first real use is declaring a service and calling it immediately:

```sql
create service if not exists my_service (
    hello(name varchar) varchar,
    get_current_time() varchar
);

execute service my_service hello('zhh');

execute service my_service get_current_time();
```

The README says this creates the first service and runs it right away. The signature is the contract: hello takes a varchar and returns a varchar. What you should see is the return value in the agent window, and the same functions reachable over HTTP at /service/my_service/hello and /service/my_service/get_current_time.

## Services, tables and workflows in one SQL file

The README's most complete example is a file passed as an argument at startup:

```bash
java -jar lealone-8.0.0-SNAPSHOT.jar services.sql
```

That file can declare a service, a table, a second service over that table, and a workflow. The README shows a user table with id long auto_increment primary key, name varchar and age int, plus add_user and find_by_name services, and a my_workflow whose start function carries a natural-language comment as its body. The README notes that all the URLs in the file are optional and exist only so you can paste them into a browser.

This is the design worth arguing about. A service with a typed signature is ordinary code generation with a schema. A workflow whose body is a Chinese sentence is not. The engine has to interpret that sentence at runtime using whichever model you configured. The README does not say whether the generated plan is cached, versioned, or re-derived on every call. For a greeting workflow that hardly matters. For anything touching the user table it matters a lot.

## Where Lealone is the wrong tool

The README does not document rollback, and it does not document what happens when the model returns something the engine cannot execute. Those are the two failure modes that decide whether this belongs near production data. If a workflow is generated from a sentence at call time, an ambiguous sentence produces an ambiguous plan, and there is no described mechanism for rejecting it.

Licensing is the second gap. The repository has a LICENSE.md file, but the metadata reports the licence as NOASSERTION, meaning GitHub could not classify it. The README links to LICENSE.md and says nothing else. If your organisation has a licence review step, this is unresolved until a human reads that file.

The third gap is release discipline. The last push to master was on 2026-09-08, so the repository is not abandoned. But the newest tagged release is lealone-6.0.1 from 2024-08-18, while the README instructs you to run an 8.0.0-SNAPSHOT. If you need a versioned artifact with a changelog, this is the wrong project right now.

## How it differs from H2, SQLite and a separate agent framework

The obvious comparison is H2, the embedded Java database most Java developers reach for. H2 gives you a JDBC URL, a file or in-memory store, and a SQL engine. It does not give you create service, create workflow, an HTTP service endpoint, or an LLM agent. Lealone's modules lealone-db and lealone-sql overlap with H2; lealone-service and lealone-agent do not.

The other comparison is an agent framework such as LangChain4j or Spring AI paired with a database. There, the agent is a separate process or library, the database is a separate dependency, and you write the glue. In Lealone the agent is a module in the same jar and the glue is SQL. The trade-off is the same one you get whenever a tool owns both halves: less wiring, and less ability to swap out either half. If you already have a database you trust and an agent stack you trust, Lealone asks you to replace both at once.

## Maintenance, upgrades and the licence question

The last push to master was on 2026-09-08, which is recent, and the repository is not archived. What is missing is a release cadence you can plan around. Three tags appear in the repository: lealone-5.2.2 on 2024-03-10, lealone-6.0.0 on 2024-03-19, and lealone-6.0.1 on 2024-08-18. Nothing after that, while the README documents an 8.0.0-SNAPSHOT. Upgrading means tracking master or rebuilding the snapshot yourself.

On licensing, the only thing that can be confirmed is that LICENSE.md exists and that the repository metadata reports NOASSERTION. That is not a licence conclusion, and it is not legal advice. It means anyone deploying Lealone commercially should read LICENSE.md directly rather than relying on a package manager's licence field.

## Conclusion

Adopt Lealone if you want a single Java process that holds a SQL database and can expose services and workflows from SQL text, and you are comfortable running a SNAPSHOT jar. Do not adopt it if you need a stable release artifact, a documented licence, or an agent whose model calls you can audit without reading the source. Verify first: which LLM provider and model the set llm command accepts, what the agent does with your api_key, and whether the Maven build produces a jar you are willing to deploy.

## FAQ

### What is Lealone?

The README describes it as a high-performance full-stack self-evolving general-purpose agent for vibe coding and enterprise applications. The repository shows a Java project containing a database, SQL layer, ORM, client and server, HTTP module, service layer and an agent module.

### How do I install and start Lealone?

Build it with mvn assembly:assembly -Dmaven.test.skip=true on JDK 21 or newer, or download the prebuilt lealone-8.0.0-SNAPSHOT.jar linked in the README. Start it with java -jar lealone-8.0.0-SNAPSHOT.jar, and add the -agent flag to open the agent window.

### Which large language models does the Lealone agent support?

The README states that doubao and deepseek are currently supported, configured through a set llm command with provider, model and api_key fields. The example uses provider 'doubao' and model 'doubao-seed-2-0-pro-260215'.

## Sources

- [Issues](https://github.com/lealone/Lealone/issues)
- [lealone/Lealone on GitHub](https://github.com/lealone/Lealone)
- [README](https://github.com/lealone/Lealone/blob/master/README.md)
- [Releases](https://github.com/lealone/Lealone/releases)

---

Hysen Labs editorial analysis, written from the project's own repository and release notes. Cite the canonical page: https://hysenlabs.com/projects/lealone-lealone
