How nobleborn/runeterra-ai works
Runeterra AI is a League of Legends lore assistant: users ask questions in a chat UI and receive locally generated, source-grounded answers. The backend retrieves lore with hybrid semantic and keyword search, selects context, and generates cited answers; it also exposes direct search and streaming chat. A separate ingestion workflow prepares champion lore and stores document chunks and embeddings. The README is empty, so capabilities and relationships here are based on the source index and shown excerpts; unsampled integrations are omitted where their wiring is unclear.
Main entry points: retrieval/service.py Hybrid retriever · ChatInterface.tsx Chat interface · rag/service.py RAG answer service · streaming.py Streaming answers
Components 25
Chat client
- Chat interface
frontend/src/components/chat/ChatInterface.tsx - Chat input
frontend/src/components/chat/ChatInput.tsx - Chat messages
frontend/src/components/chat/ChatMessage.tsx - Source list
frontend/src/components/chat/SourceList.tsx - Chat API client
frontend/src/lib/api.ts - Conversation history
frontend/src/lib/chatHistory.ts
API and orchestration
- HTTP API
backend/app/main.py
Lore retrieval
- Hybrid retriever
backend/app/retrieval/service.py - Semantic search
backend/app/retrieval/semantic.py - Keyword search
backend/app/retrieval/keyword.py - Keyword processing
backend/app/retrieval/query_processing.py - Rank fusion
backend/app/retrieval/fusion.py
Grounded answering
- RAG answer service
backend/app/rag/service.py - Streaming answers
backend/app/rag/streaming.py - Query rewriting
backend/app/rag/query_rewriter.py - Context selection
backend/app/rag/context.py - Answer prompts
backend/app/rag/prompts.py
Lore ingestion
- Lore sources
backend/app/ingestion/sources.py - Ingestion pipeline
backend/app/ingestion/pipeline.py - Text processing
backend/app/ingestion/text_processing.py - Database access
backend/app/db.py - Model client
backend/app/ollama_client.py
Other components
- Lore seeker
- Ollama models
- Lore database
Connections 31
- Lore seeker → Chat interface: asks lore
- Chat interface → Chat input: renders
frontend/src/components/chat/ChatInterface.tsx - Chat interface → Chat API client: streams request
frontend/src/components/chat/ChatInterface.tsx - Chat interface → Conversation history: builds history
frontend/src/components/chat/ChatInterface.tsx - Chat interface → Chat messages: renders
frontend/src/components/chat/ChatInterface.tsx - Chat messages → Source list: renders
frontend/src/components/chat/ChatMessage.tsx - Chat API client → HTTP API: calls stream
- HTTP API → RAG answer service: answers chat
backend/app/main.py - HTTP API → Streaming answers: streams answer
backend/app/main.py - HTTP API → Hybrid retriever: searches lore
backend/app/main.py - RAG answer service → Hybrid retriever: retrieves passages
backend/app/rag/service.py - RAG answer service → Context selection: selects context
backend/app/rag/service.py - RAG answer service → Answer prompts: uses prompt
backend/app/rag/service.py - RAG answer service → Ollama models: generates answer
- Streaming answers → Hybrid retriever: retrieves passages
backend/app/rag/streaming.py - Streaming answers → Context selection: selects context
backend/app/rag/streaming.py - Streaming answers → Query rewriting: rewrites query
backend/app/rag/streaming.py - Streaming answers → Answer prompts: uses prompt
backend/app/rag/streaming.py - Query rewriting → Ollama models: rewrites with
backend/app/rag/query_rewriter.py - Hybrid retriever → Semantic search: runs search
backend/app/retrieval/service.py - Hybrid retriever → Keyword search: runs search
backend/app/retrieval/service.py - Hybrid retriever → Rank fusion: fuses rankings
backend/app/retrieval/service.py - Keyword search → Keyword processing: prepares query
backend/app/retrieval/keyword.py - Semantic search → Database access: queries vectors
backend/app/retrieval/semantic.py - Semantic search → Model client: embeds query
backend/app/retrieval/semantic.py - Keyword search → Database access: queries text
backend/app/retrieval/keyword.py - Database access → Lore database: connects to
- Lore sources → Ingestion pipeline: supplies documents
- Ingestion pipeline → Text processing: chunks content
backend/app/ingestion/pipeline.py - Ingestion pipeline → Model client: generates embeddings
backend/app/ingestion/pipeline.py - Ingestion pipeline → Database access: stores records
backend/app/ingestion/pipeline.py