Skip to content

YTyangtao666/inkmuse

Repository files navigation

墨 InkMuse · 智能叙事工坊

AI-Powered Novel Writing Platform

RAG · Style Profiling · Story Context Engine · Multi-Mode Document Generation

Java Spring Boot Vue Element Plus LangChain4j License: MIT PRs Welcome


Screenshots

🔐 Login — Dark Theme 🏠 Dashboard
Login Dashboard
✍️ Chapter Editor + AI Sidebar 🎨 Style Profile (AI Analysis)
Chapter Editor Style Profile
📚 Knowledge Base (RAG) 📝 Multi-Mode Document Generation
Knowledge Base Document Generation
🤖 AI Writing Assistant ⚙️ Admin Dashboard
AI Assistant Admin Dashboard

English Documentation

Overview

InkMuse is a full-stack AI novel writing platform that helps authors create, expand, and polish their stories with LLM-powered assistance. It features RAG-based knowledge base retrieval, AI style profiling, multi-mode document generation, and a rich chapter editor with real-time AI writing tools.

Features

Novel Writing

  • Chapter Editor — Rich text editor with AI sidebar (continue, expand, polish, title generation)
  • Story Context Engine — Auto-injects characters, worldbook, outlines, and previous chapter content into AI prompts
  • Version History — Track and restore chapter versions
  • Export — TXT / Markdown / DOCX

AI Capabilities

  • AI Continuation — Context-aware story continuation with character/setting awareness
  • Style Profiling — Upload sample texts to analyze and replicate an author's writing style
  • RAG Knowledge Base — Upload reference documents for AI-assisted retrieval
  • Multi-Mode Documents — Articles, blogs, WeChat/Xiaohongshu/Douyin copy, e-commerce, ads
  • AI Assistant — Conversational writing helper with KB-grounded responses

Platform

  • Dual Frontend — User portal (5175) + Admin dashboard (5174)
  • JWT Authentication — Role-based access control (USER / ADMIN)
  • Admin System — User management, content moderation, AI usage logs, system settings
  • Auto-save — Chapter content auto-saved with debounce

Tech Stack

Layer Technology
Backend Java 17, Spring Boot 3.2.5, MyBatis-Plus 3.5.7, LangChain4j 0.35.0
AI/ML DeepSeek API (deepseek-chat), RAG with embedding search
Database MySQL 8+, Redis, Flyway migrations
Frontend (User) Vue 3, TypeScript, Element Plus, Vite, Pinia, ECharts
Frontend (Admin) Vue 3, TypeScript, Element Plus, Vite, Pinia

Quick Start

# 1. Clone
git clone https://github.com/YTyangtao666/inkmuse.git
cd inkmuse

# 2. Database (MySQL 8+)
mysql -u root -p -e "CREATE DATABASE IF NOT EXISTS inkmuse DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;"

# 3. Backend
cd server
export MYSQL_PASS=your_mysql_password
export LLM_API_KEY=your_deepseek_api_key
export JWT_SECRET=your_custom_jwt_secret_min_32_chars
export JAVA_HOME=/path/to/jdk17
mvn spring-boot:run -Dmaven.test.skip=true    # runs on :8080

# 4. Frontend (User Portal)
cd ../web-user
pnpm install && pnpm dev    # runs on :5175

# 5. Frontend (Admin Dashboard)
cd ../web-admin
pnpm install && pnpm dev    # runs on :5174

# 6. Create Admin User
curl -X POST http://localhost:8080/api/auth/register \
  -H "Content-Type: application/json" \
  -d '{"username":"admin","email":"admin@example.com","password":"your_password"}'
mysql -u root -p inkmuse -e "UPDATE user SET role='ADMIN' WHERE username='admin';"

Environment Variables

Variable Description Default
MYSQL_PASS MySQL password changeme
LLM_API_KEY DeepSeek API key (required)
LLM_MODEL Model name deepseek-chat
JWT_SECRET JWT signing secret (development default)
EMBED_API_KEY Embedding API key (for RAG) (optional)
REDIS_HOST Redis host localhost

Architecture Highlights

Story Context Engine: When a user continues writing, the system auto-assembles context from:

  • Novel metadata (title, description, genre)
  • Top 5 characters (personality, background)
  • Top 3 worldbook entries
  • Previous chapter's last 2000 characters
  • Top 3 outline entries

Style Profile System: Upload sample texts → AI analyzes sentence patterns, vocabulary, narrative perspective, and tone → produces a "style fingerprint" → bind to novels → AI generation matches the author's voice.

Stats

  • 206 Java source files · 44 Vue components · 20 database tables · 5 Flyway migrations

中文文档

项目简介

InkMuse(智能叙事工坊)是一个全栈 AI 小说创作平台,集成大语言模型辅助创作、RAG 知识库检索、AI 文风分析和多模态文档生成。作者可以在沉浸式的暗色主题编辑器中创作,AI 会基于角色设定、世界观、大纲和前文内容智能续写。

核心功能

小说创作

  • 章节编辑器 — 富文本编辑器 + AI 侧边栏(续写、扩写、润色、起名)
  • 故事上下文引擎 — 自动注入角色、世界观、大纲、前文摘要到 AI 提示词
  • 版本历史 — 章节版本追踪与回退
  • 导出 — TXT / Markdown / DOCX

AI 能力

  • AI 续写 — 基于角色设定的上下文感知续写
  • 文风分析 — 上传样本文本,AI 分析并生成"风格指纹",可绑定到小说
  • RAG 知识库 — 上传参考文档,支持向量检索
  • 多模态文档生成 — 文章、博客、公众号、小红书、抖音、电商、广告
  • AI 创作助手 — 对话式写作辅助,支持知识库问答模式

平台

  • 双前端 — 用户端(5175)+ 管理后台(5174)
  • JWT 认证 — 基于角色的访问控制(USER / ADMIN)
  • 管理系统 — 用户管理、内容审核、AI 日志、系统设置

技术栈

技术
后端 Java 17, Spring Boot 3.2.5, MyBatis-Plus 3.5.7, LangChain4j 0.35.0
AI DeepSeek API (deepseek-chat), RAG 向量检索
数据库 MySQL 8+, Redis, Flyway 迁移
前端(用户) Vue 3, TypeScript, Element Plus, Vite, Pinia, ECharts
前端(管理) Vue 3, TypeScript, Element Plus, Vite, Pinia

项目结构

inkmuse/
├── server/                    # Spring Boot 后端
│   └── src/main/java/com/inkmuse/
│       ├── auth/              # JWT 认证 + Spring Security
│       ├── novel/             # 小说 CRUD
│       ├── chapter/           # 章节 CRUD + 自动保存
│       ├── ai/                # AI 生成 + 故事上下文 + RAG
│       ├── kb/                # 知识库(上传、分块、嵌入)
│       ├── style/             # 文风档案(AI 文风分析)
│       ├── document/          # 多模态文档生成
│       ├── admin/             # 管理后台 API
│       └── common/            # 响应封装、配置
│
├── web-user/                  # Vue 3 用户端 (5175)
├── web-admin/                 # Vue 3 管理后台 (5174)
└── deploy/
    └── docker-compose.yml     # MySQL + Redis

快速开始

# 1. 克隆
git clone https://github.com/YTyangtao666/inkmuse.git
cd inkmuse

# 2. 数据库 (MySQL 8+)
mysql -u root -p -e "CREATE DATABASE IF NOT EXISTS inkmuse DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;"

# 3. 后端
cd server
export MYSQL_PASS=your_mysql_password
export LLM_API_KEY=your_deepseek_api_key
export JWT_SECRET=your_custom_jwt_secret_min_32_chars
export JAVA_HOME=/path/to/jdk17
mvn spring-boot:run -Dmaven.test.skip=true    # 端口 :8080

# 4. 用户端前端
cd ../web-user
pnpm install && pnpm dev    # 端口 :5175

# 5. 管理后台前端
cd ../web-admin
pnpm install && pnpm dev    # 端口 :5174

# 6. 创建管理员账号
curl -X POST http://localhost:8080/api/auth/register \
  -H "Content-Type: application/json" \
  -d '{"username":"admin","email":"admin@example.com","password":"your_password"}'
mysql -u root -p inkmuse -e "UPDATE user SET role='ADMIN' WHERE username='admin';"

环境变量

变量 说明 默认值
MYSQL_PASS MySQL 密码 changeme
LLM_API_KEY DeepSeek API Key (必填)
LLM_MODEL 模型名称 deepseek-chat
JWT_SECRET JWT 签名密钥 (开发默认值)
EMBED_API_KEY Embedding API Key(RAG 用) (可选)
REDIS_HOST Redis 地址 localhost

数据库表

20 张表(5 个 Flyway 迁移):user, novel, volume, chapter, chapter_version, character, worldbook, outline, asset, kb_doc, kb_chunk, ai_chat_session, ai_chat_message, prompt_template, ai_usage_log, sys_log, style_profile, document, timeline_event, system_settings


License

MIT License — see LICENSE.

Author

阳涛 (Yang Tao) GitHub: @YTyangtao666

Contributing

Contributions are welcome! Please read CONTRIBUTING.md for guidelines.

About

InkMuse - AI-Powered Novel Writing Platform with RAG, Style Profiling and Multi-Mode Document Generation. Spring Boot 3 + Vue 3 + LangChain4j + DeepSeek.

Topics

Resources

License

Contributing

Stars

1 star

Watchers

0 watching

Forks

Packages

 
 
 

Contributors