English | 简体中文
The foundational bedrock for the entire RimMind AI ecosystem.
RimMind-Core provides the foundational AI infrastructure and runtime environment for the RimMind mod suite. Every gameplay submodule (Actions, Advisor, Dialogue, Memory, Personality, Storyteller, Bridges) depends solely on the public contracts exposed by RimMind-Core.
- 4-Zone KV-Cache Orchestrator: Separates invariant world rules (Zone 1) and permanent pawn profiles (Zone 2) from dynamic history (Zone 3) and volatile environment states (Zone 4), delivering an 80%+ prefix cache hit rate.
- Asynchronous Priority Request Queue: Thread-safe background HTTP/JSON dispatching with exponential backoff retries, rate limiting, and main-thread Unity callback marshaling.
- Native ToolCall Contract Registry: Type-safe tool definitions, JSON schema validation, and structured tool execution eliminating markdown formatting errors.
- F8 Central Debug & Inspection Hub: In-game control station for live latency ping tests, queue flush/pause controls, and raw colonist context inspections.
The in-game F8 RimMind Debug Center. Developers and players can test real-time LLM API connectivity, monitor token cache efficiency, and tune concurrency parameters live.
flowchart TD
subgraph Submodules ["Dependent Submodules"]
Actions["RimMind-Actions"]
Advisor["RimMind-Advisor"]
Dialogue["RimMind-Dialogue"]
Memory["RimMind-Memory"]
Personality["RimMind-Personality"]
Storyteller["RimMind-Storyteller"]
end
subgraph Core ["RimMind-Core"]
API["Public API (RimMindAPI)"]
Context["4-Zone Context Orchestrator"]
Queue["Async Priority Request Queue"]
ToolRegistry["ToolCall Contract Registry"]
F8Hub["F8 Debug Center & UI Framework"]
end
subgraph Network ["Network Layer (Background Thread)"]
ClientFactory["IAIClientFactory / Providers"]
OpenAI["OpenAI / DeepSeek Client"]
Player2["Player2 Local/Cloud Client"]
end
Submodules -->|Depend solely on Public API| API
API --> Context
API --> Queue
API --> ToolRegistry
F8Hub --> Queue
Queue --> ClientFactory
ClientFactory --> OpenAI
ClientFactory --> Player2
In RimWorld's mod manager, ensure RimMind-Core is loaded right after Harmony and the vanilla Core game:
1. Harmony
2. Core (Vanilla RimWorld)
3. RimMind-Core
4. [Other RimMind submodules, loaded in any order]
Configurable via Options -> Mod Settings -> RimMind-Core:
| Setting | Default | Description |
|---|---|---|
| AI Provider | openai |
Supports OpenAI-compatible endpoints, DeepSeek, and Player2 |
| API Endpoint | https://api.deepseek.com/v1 |
URL for the OpenAI Chat Completions compatible endpoint |
| Model Name | deepseek-chat |
Target LLM model identifier |
| Max Concurrent Requests | 3 |
Maximum simultaneous requests sent to the LLM (1~10) |
| Request Timeout | 60s |
Maximum wait time for LLM response before timeout (10s~180s) |
| Request Overlay | Enabled |
Floating status widget in the lower right showing active requests |
| Verbose Logging | Disabled |
Outputs detailed payload traces to Player.log |
Run unit tests and architectural invariant tests from the repository root:
# Run all unit tests
dotnet test RimMind-Core/Tests/RimMindCore.Tests.csproj -c Release
# Run architecture contract guard tests
dotnet test RimMind-Core/ArchTests/RimMindCore.ArchTests.csproj -c ReleaseLicensed under the MIT License.