An AI-powered chatbot that acts as a knowledgeable Elden Ring player. Ask it about boss strategies, lore, rune rewards, and Shadow of the Erdtree content. It uses Claude (via the Anthropic API) combined with the Model Context Protocol (MCP) to look up live boss data from a local REST API backed by PostgreSQL.
Live demo: https://ai-agent--AidenThomas3.replit.app
The app is password protected. Reach out if you'd like access and I'll send you the password.
- Conversational AI — streams responses from Claude with a typing effect in the browser
- MCP tool use — the assistant can call
list_bossesandget_bosstools to fetch accurate data mid-conversation rather than hallucinating - RAG knowledge base — a local
knowledge.txtfile is semantically searched at query time and injected into the system prompt, giving Claude grounded, detailed strategy notes - REST API — a standalone FastAPI service exposes the boss database over HTTP; the MCP server calls this API to serve the chatbot
- PostgreSQL database — boss data is stored in a real database (seeded from the original JSON files)
Browser
└── Flask app (port 5000)
├── RAG (sentence-transformers, knowledge.txt)
├── Anthropic Claude API (streaming)
└── MCP client → MCP server subprocess (per request)
└── Elden Ring API (port 8000, FastAPI + PostgreSQL)
Three processes run independently:
| Process | Command | Port |
|---|---|---|
| Flask chat app | python app.py |
5000 |
| Elden Ring REST API | cd API && uvicorn main:app --host localhost --port 8000 |
8000 |
| MCP server | spawned automatically per chat request | — |
- Python 3.12+
- A PostgreSQL database (Replit provides one automatically via
DATABASE_URL) - An Anthropic API key
pip install -r requirements.txtIf you plan to use vector search, also install chromadb separately:
pip install chromadb(it is intentionally excluded fromrequirements.txtas it is optional and can block deployment builds).
Create a .env file in the project root (or set these as environment secrets):
ANTHROPIC_API_KEY=your-api-key-here
The database connection is read from DATABASE_URL (set automatically on Replit, or configure it yourself for local development).
Vector search uses ChromaDB and is disabled by default. To enable it:
- Install chromadb:
pip install chromadb
- Set the environment variable:
VECTORDB_ENABLED=1
When enabled, the app embeds all game entities into a local Chroma collection on startup and the semantic_search MCP tool becomes available for conceptual queries (e.g. "intelligence-scaling weapons", "bosses weak to bleed"). Without it, all other tools work normally.
The boss table needs to exist before the API will work. Connect to your PostgreSQL database and run:
CREATE TABLE IF NOT EXISTS bosses (
id TEXT PRIMARY KEY,
name TEXT NOT NULL,
description TEXT,
runes INTEGER
);Then insert the boss records from API/data/bosses.json, or run the app and use the API to verify the table is populated.
Start the Elden Ring API first, then the Flask app:
# Terminal 1 — REST API
cd API && uvicorn main:app --host localhost --port 8000
# Terminal 2 — Chat app
python app.pyThen open http://localhost:5000 in your browser.
├── app.py # Flask app — agentic loop, SSE streaming, RAG
├── requirements.txt
├── templates/
│ └── index.html # Chat UI (vanilla JS, marked.js for markdown)
├── MCP/
│ ├── server.py # MCP server — exposes list_bosses / get_boss tools
│ ├── rag.py # Semantic search over knowledge.txt
│ └── knowledge.txt # Boss strategy & lore knowledge base
└── API/
├── main.py # FastAPI entry point
├── data/
│ └── bosses.json # Original seed data
├── db/
│ ├── loader.py # PostgreSQL connection (psycopg2)
│ └── driver.py # Query builder (JSONDriver)
└── routers/
└── _base.py # Generic router factory (list + detail endpoints)
The Elden Ring API runs on localhost:8000. Interactive docs are available at http://localhost:8000/docs.
| Method | Path | Description |
|---|---|---|
GET |
/bosses |
List bosses — supports ?name=, ?page=, ?limit= |
GET |
/bosses/{id} |
Get a single boss by ID |
curl http://localhost:8000/bosses?name=messmer
curl http://localhost:8000/bosses/3- Add rows to the
bossestable (or create a new table for a new model) - Register the new model in
API/main.py:app.include_router(make_router("weapons"))
- Add a new MCP tool in
MCP/server.pythat calls the new endpoint - Update
MCP/knowledge.txtwith relevant knowledge for the new data