SpringBoot kitchen sink for ChatGPT, vector RAG, and MidJourney
A Java learning backend that wraps OpenAI APIs into chat, document Q&A, image generation, and text adventure games.

What it does
FunAi is a SpringBoot backend that acts as a thick integration layer around OpenAI’s APIs. It offers multi-session ChatGPT and GPT-4 chat with context caching, a retrieval-augmented document Q&A pipeline over PDFs and Office files via Pinecone or Milvus, and hooks for MidJourney and Stable Diffusion image generation. The codebase also bundles AI customer service, prompt management, user tiering, and text adventure game logic.
The interesting bit
Despite billing itself as a learning project, it tackles the unglamorous plumbing that production wrappers need: a polling scheduler to rotate OpenAI API keys and dodge free-tier rate limits, recursive text chunking for embedding-based search, and Guava Cache to keep conversation context responsive. It is essentially a maximalist reference architecture for Java developers wondering how to wire LLMs into a traditional web stack.
Key highlights
- Wraps OpenAI chat, embeddings, and image generation behind a
SpringBootbackend with SSE streaming and multi-session history. - Document Q&A pipeline: parses PDFs and Office files, recursively chunks text, vectorizes via OpenAI embeddings, and retrieves semantically similar passages from
PineconeorMilvus. - API key pool with a polling scheduler to distribute requests and detect invalid or exhausted keys.
- Includes gamified text adventures, AI customer service, and dynamic prompt libraries with role-based access.
- Runs only with overseas network access or an overseas server due to OpenAI API reachability.
Caveats
- Several headline features—human handoff for customer service, resume analysis, spoken practice, and the “devil community”—are still marked
TODOin the README. - The matching frontend repository is not yet open-sourced, so this release is backend-only.
- The author explicitly restricts commercial use without permission, which limits its utility as a drop-in foundation despite the
Apache-2.0license.
Verdict Java developers who want a sprawling, real-world reference for gluing OpenAI services into a monolithic web app will find plenty of wiring to study. If you need a lean, library-style SDK or a fully open, production-ready product, look elsewhere.
Frequently asked
- What is PenglongHuang/ChatGPT-Java-FunAi?
- A Java learning backend that wraps OpenAI APIs into chat, document Q&A, image generation, and text adventure games.
- Is ChatGPT-Java-FunAi open source?
- Yes — PenglongHuang/ChatGPT-Java-FunAi is open source, released under the Apache-2.0 license.
- What language is ChatGPT-Java-FunAi written in?
- PenglongHuang/ChatGPT-Java-FunAi is primarily written in Java.
- How popular is ChatGPT-Java-FunAi?
- PenglongHuang/ChatGPT-Java-FunAi has 945 stars on GitHub.
- Where can I find ChatGPT-Java-FunAi?
- PenglongHuang/ChatGPT-Java-FunAi is on GitHub at https://github.com/PenglongHuang/ChatGPT-Java-FunAi.