Intro
Building an AI-based novel setting management platform that automatically extracts and organizes characters, locations, and items from stories while detecting consistency issues.
- Enables writers to view and manage novel settings (characters, items, places, relationships) in a structured way.
- Incorporates AI-powered extraction to detect setting conflicts (e.g., timeline or attribute mismatches).
- Provides a UI for exploring setting data, making it easier to maintain narrative consistency in long-form writing.
- Designed with extensibility for LLM-based reasoning and retrieval-augmented workflows.
Tech Stack
- Languages: Python, TypeScript, SQL
- Backend / API: FastAPI (Python), PostgreSQL with SQLAlchemy + Alembic for ORM/migrations
- Frontend: React (Next.js), Tailwind CSS
- AI/NLP: OpenAI API (LLM-based entity & relation extraction), custom prompt pipelines for tagging and conflict detection
- Database Design:
EntityAttributeAppearance – track character traits, items, and places across scenes
CharacterScene, CharacterItem, PlaceScene – link entities to narrative contexts
- Infra: Docker (local development), Vercel (frontend deployment), Render/Railway (backend hosting)
Key Contribution
- Designed a relational database schema in PostgreSQL to capture narrative entities and their relationships, including
EntityAttributeAppearance, CharacterScene, CharacterItem, and PlaceScene.
- Implemented the backend architecture with FastAPI and PostgreSQL, exposing REST APIs for managing characters, items, places, and scenes, while ensuring consistent cross-entity retrieval.
- Developed an LLM-powered entity extraction pipeline using the OpenAI API, capable of identifying characters, items, places, and relationships directly from novel text and mapping them into the database.
Problem & Solution
Problem 1: Structuring complex relationships among entities
- Problem: Novels involve diverse entities (skills, items, places, characters) that must maintain multiple relationship types. For example, places require hierarchical relations (country → city → district).