OpenGPA

Free and open General Purpose Agent

GitHubスター

58

ユーザー評価

未評価

お気に入り

0

閲覧数

4

フォーク

4

イシュー

2

README
OpenGPA - Self-hosted General Purpose Agent

Twitter Follow
License: MIT

OpenGPA is an Open-source General Purpose Agent. A self-hosted solution supporting smart AI agent developments
with chain of thought, tool use and memory access through RAG.

  • Agentic system with multi-step-reasoning, chain-of-thought, ReAct, tool use etc
  • Support for all major LLMs such as LLama, Mistral, Anthropic, OpenAI, etc.
  • Off-line first. You can run on your own box with a local LLM. Data won't leave the server. All the power of GPT without the data privacy nightmare.
  • Extensible framework allows to plug your own actions, such as calling into internal services and APIs
  • Simple UI exposing insight on the GPA internal reasoning and actions
  • Built-in RAG to search internal document stores
  • Free and open source, deploy anywhere, customize to your needs

:pencil2: Design principles

OpenGPA is much more than a UI on top of a LLM. It implements an agentic workflow, where a LLM is used as the
brain of an agent to reason through multiple steps of planning, reasoning, and tool use. In particular, OpenGpa
is using the ReAct approach to verbally reason on the next step, decide on the action to execute,
and observe the outcome.

{
  "reasoning": "The user wants to know the current weather in Liege, Belgium. 
                The best action to get this information is to perform a web search with 
                the query 'current weather in Liege, Belgium'. The result of this action 
                will then be used to respond to the user's request. 
                This is not the final action as we have to get the results from the web 
                search first."
  "action": {
    "name": "webSearch",
    "arguments": {
      "query": "current weather in Liege, Belgium"
    }
  },
  "is_final": false
}

Action selection is based on a catalog of action that can easily be extended through code. You could add an action
to tap into an internal service to fetch some data, or a workflow engine to trigger a next step, etc.

🛠️️ Key Features

The current version already packs a few interesting pieces:

  • Works with all LLM supported by spring-ai, including running LLama locally
  • Multi-step task processing with chain-of-thought approach
  • Action model with easy to extend actions for use by the agent
  • Upload of artifacts to process by the agent
  • Download of artifacts generated by the agent
  • Import documents in knowledge base to support Retrieval Augmented Generation search
  • Web browsing and web search
  • Model Context Protocol MCP tap into existing enterprise APIs
🚧 Roadmap

Improve the Agentic capabilities:

  • Memory enabling the agent to remember key facts and use them later
  • code generation and execution within the agent (using Groovy scripts?)
  • scheduled jobs for automating workflow
  • triggers to create complete end-to-end workflows

Make OpenGPA enterprise ready:

  • Persistence of tasks/steps
  • Auditing of task processing costs (token usage)
  • Instrumentation and observability
🚀 Getting started

In case of trouble, please reach out on Discord for help!

Quickstart (no need to clone this repo)

The docker-compose.quickstart.yml makes it easy to launch the latest stable version with
a postgresql database (with pg_vector extension), the opengpa backend and the frontend, on the same
host.

curl -O https://raw.githubusercontent.com/eschnou/OpenGPA/main/docker-compose.quickstart.yml
echo "OPENAI_API_KEY=your-key-here" > .env
docker compose -f docker-compose.quickstart.yml up -d
Build and run with Docker

The simplest way to build and launch OpenGPA is using the provided Docker compose file:

export OPENAI_API_KEY=sk-*** 
docker compose up --build

This will build the opengpa image from source with all required dependencies (in particular the Playwright
dependencies for web browsing) and launch the service on port 3000. Opening http://localhost:3000 will lead you
to the OpenAPI documentation.

Build and run the server

If you are on a Mac, the following should be enough to get you started and running this
locally.

[!WARNING]
Building requires Java 21. If you are on a Mac, you can easily install it
with brew install openjdk@21

By default, opengpa is using OpenAI gpt-4o as its LLM. Check the application.properties file
for configuration options and the spring-ai documentation to configure support for other LLMs.

mvn clean package -Pproduction
docker compose up -d db
OPENAI_API_KEY=sk-*** java -jar opengpa-server/target/opengpa-server-0.2.0.jar

The docker compose up -d db lauches the database part from the docker compose as opengpa requires
a postgres database with pg_vector for the RAG feature.

🖥️ User Interface

The User Interface is available in the OpenGPA Frontend repository and
can be launched with docker.

git clone https://github.com/eschnou/opengpa-frontend
cd opengpa-frontend
docker build -t opengpa-frontend:latest .
docker run -p 8000:8000 opengpa-frontend
🐛 Debugging

For debugging purposes you can log all interactions and prompts using the following config:

opengpa.server.log-prompt=true
opengpa.server.log-folder=/tmp/opengpa/logs
🤖 REST API

You can interact with your agent programatically through the REST API. The up-to-date API Documentation
is available on the backend server at http://localhost:3000/swagger-ui.html
with Swagger. You can also download the yml or json
version of the API Documentation.

Using MCP with OpenGPA

OpenGPA can leverage MCP to connect to third party services and use
their tools. You can look at the maintained list of servers on the official repository or
on marketplaces like mcp.so.

MCP cannot be used with the starter Docker image. You need to rebuild your own docker image or run the java server
directly from CLI. In order to use MCP, you should:

  1. Configure the path to your MCP server configuration in application.properties
spring.ai.mcp.client.stdio.servers-configuration=/path/to/mcp-servers.json
  1. Configure your mcp-servers.json
{
  "mcpServers": {
      "time": {
        "command": "docker",
        "args": ["run", "-i", "--rm", "mcp/time"]
      }
  }
}
📚 Using OpenGPA Libraries

OpenGPA is designed as a modular system with reusable libraries. You can integrate these libraries into your own Java applications.

Maven Repository

Our libraries are hosted at https://dist.opengpa.org/packages. To use them, add the repository to your pom.xml:

<repositories>
    <repository>
        <id>opengpa-repository</id>
        <name>OpenGPA Repository</name>
        <url>https://dist.opengpa.org/packages</url>
    </repository>
</repositories>
Available Modules
Core Module

The core module provides the foundational components for building agentic applications:

<dependency>
    <groupId>org.opengpa</groupId>
    <artifactId>opengpa-core</artifactId>
    <version>0.4.0</version>
</dependency>
Actions Module

For integrating with the extended action catalog:

<dependency>
    <groupId>org.opengpa</groupId>
    <artifactId>opengpa-actions</artifactId>
    <version>0.4.0</version>
</dependency>
RAG Module

For retrieval-augmented generation capabilities:

<dependency>
    <groupId>org.opengpa</groupId>
    <artifactId>opengpa-rag</artifactId>
    <version>0.4.0</version>
</dependency>
MCP Module

For Model Context Protocol integration:

<dependency>
    <groupId>org.opengpa</groupId>
    <artifactId>opengpa-mcp</artifactId>
    <version>0.4.0</version>
</dependency>
Documentation
Support
License

MIT License

Copyright (c) 2024-2025 Laurent Eschenauer

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.