ai-character-engine 1.0.0__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (258) hide show
  1. ai_character_engine-1.0.0/LICENSE +202 -0
  2. ai_character_engine-1.0.0/MANIFEST.in +6 -0
  3. ai_character_engine-1.0.0/PKG-INFO +219 -0
  4. ai_character_engine-1.0.0/README.de.md +165 -0
  5. ai_character_engine-1.0.0/README.es.md +165 -0
  6. ai_character_engine-1.0.0/README.fr.md +165 -0
  7. ai_character_engine-1.0.0/README.ja.md +165 -0
  8. ai_character_engine-1.0.0/README.ko.md +165 -0
  9. ai_character_engine-1.0.0/README.md +165 -0
  10. ai_character_engine-1.0.0/README.pt-BR.md +165 -0
  11. ai_character_engine-1.0.0/README.zh-CN.md +165 -0
  12. ai_character_engine-1.0.0/README.zh-TW.md +165 -0
  13. ai_character_engine-1.0.0/docs/assets/badge-license.svg +6 -0
  14. ai_character_engine-1.0.0/docs/assets/badge-platforms.svg +6 -0
  15. ai_character_engine-1.0.0/docs/assets/badge-python.svg +6 -0
  16. ai_character_engine-1.0.0/docs/assets/badge-version.svg +6 -0
  17. ai_character_engine-1.0.0/docs/assets/readme-banner.svg +21 -0
  18. ai_character_engine-1.0.0/pyproject.toml +45 -0
  19. ai_character_engine-1.0.0/setup.cfg +4 -0
  20. ai_character_engine-1.0.0/skills/ai-character-engine/SKILL.md +62 -0
  21. ai_character_engine-1.0.0/skills/ai-character-engine/agents/openai.yaml +4 -0
  22. ai_character_engine-1.0.0/skills/ai-character-engine/references/cognition-and-hosts.md +48 -0
  23. ai_character_engine-1.0.0/skills/ai-character-engine/references/integration.md +133 -0
  24. ai_character_engine-1.0.0/src/ai_character_engine/__init__.py +788 -0
  25. ai_character_engine-1.0.0/src/ai_character_engine/_version.py +1 -0
  26. ai_character_engine-1.0.0/src/ai_character_engine/autonomy/__init__.py +25 -0
  27. ai_character_engine-1.0.0/src/ai_character_engine/autonomy/controller.py +67 -0
  28. ai_character_engine-1.0.0/src/ai_character_engine/autonomy/models.py +142 -0
  29. ai_character_engine-1.0.0/src/ai_character_engine/autonomy/policy.py +71 -0
  30. ai_character_engine-1.0.0/src/ai_character_engine/autonomy/scheduler.py +201 -0
  31. ai_character_engine-1.0.0/src/ai_character_engine/avatar/__init__.py +37 -0
  32. ai_character_engine-1.0.0/src/ai_character_engine/avatar/behavior.py +671 -0
  33. ai_character_engine-1.0.0/src/ai_character_engine/avatar/envelope.py +83 -0
  34. ai_character_engine-1.0.0/src/ai_character_engine/avatar/models.py +186 -0
  35. ai_character_engine-1.0.0/src/ai_character_engine/avatar/runtime.py +116 -0
  36. ai_character_engine-1.0.0/src/ai_character_engine/avatar/scheduler.py +112 -0
  37. ai_character_engine-1.0.0/src/ai_character_engine/avatar/viseme.py +167 -0
  38. ai_character_engine-1.0.0/src/ai_character_engine/character/__init__.py +0 -0
  39. ai_character_engine-1.0.0/src/ai_character_engine/character/profile.py +18 -0
  40. ai_character_engine-1.0.0/src/ai_character_engine/cognition/__init__.py +80 -0
  41. ai_character_engine-1.0.0/src/ai_character_engine/cognition/background.py +1132 -0
  42. ai_character_engine-1.0.0/src/ai_character_engine/cognition/errors.py +10 -0
  43. ai_character_engine-1.0.0/src/ai_character_engine/cognition/models.py +125 -0
  44. ai_character_engine-1.0.0/src/ai_character_engine/cognition/router.py +160 -0
  45. ai_character_engine-1.0.0/src/ai_character_engine/cognition/runtime.py +175 -0
  46. ai_character_engine-1.0.0/src/ai_character_engine/cognition/tasks.py +59 -0
  47. ai_character_engine-1.0.0/src/ai_character_engine/cognitive_evaluation/__init__.py +21 -0
  48. ai_character_engine-1.0.0/src/ai_character_engine/cognitive_evaluation/__main__.py +36 -0
  49. ai_character_engine-1.0.0/src/ai_character_engine/cognitive_evaluation/dataset.py +114 -0
  50. ai_character_engine-1.0.0/src/ai_character_engine/cognitive_evaluation/evaluator.py +386 -0
  51. ai_character_engine-1.0.0/src/ai_character_engine/cognitive_evaluation/models.py +490 -0
  52. ai_character_engine-1.0.0/src/ai_character_engine/collaboration/__init__.py +32 -0
  53. ai_character_engine-1.0.0/src/ai_character_engine/collaboration/models.py +237 -0
  54. ai_character_engine-1.0.0/src/ai_character_engine/collaboration/runtime.py +720 -0
  55. ai_character_engine-1.0.0/src/ai_character_engine/commit/__init__.py +19 -0
  56. ai_character_engine-1.0.0/src/ai_character_engine/commit/coordinator.py +1068 -0
  57. ai_character_engine-1.0.0/src/ai_character_engine/commit/models.py +80 -0
  58. ai_character_engine-1.0.0/src/ai_character_engine/companion/__init__.py +27 -0
  59. ai_character_engine-1.0.0/src/ai_character_engine/companion/access.py +203 -0
  60. ai_character_engine-1.0.0/src/ai_character_engine/companion/companion.py +1944 -0
  61. ai_character_engine-1.0.0/src/ai_character_engine/companion/settings.py +94 -0
  62. ai_character_engine-1.0.0/src/ai_character_engine/compatibility/__init__.py +53 -0
  63. ai_character_engine-1.0.0/src/ai_character_engine/compatibility/__main__.py +69 -0
  64. ai_character_engine-1.0.0/src/ai_character_engine/compatibility/checker.py +173 -0
  65. ai_character_engine-1.0.0/src/ai_character_engine/compatibility/contracts.py +61 -0
  66. ai_character_engine-1.0.0/src/ai_character_engine/compatibility/manifest.py +143 -0
  67. ai_character_engine-1.0.0/src/ai_character_engine/compatibility/models.py +205 -0
  68. ai_character_engine-1.0.0/src/ai_character_engine/context/__init__.py +19 -0
  69. ai_character_engine-1.0.0/src/ai_character_engine/context/budget.py +156 -0
  70. ai_character_engine-1.0.0/src/ai_character_engine/context/builder.py +877 -0
  71. ai_character_engine-1.0.0/src/ai_character_engine/distributed/__init__.py +47 -0
  72. ai_character_engine-1.0.0/src/ai_character_engine/distributed/broker.py +322 -0
  73. ai_character_engine-1.0.0/src/ai_character_engine/distributed/errors.py +14 -0
  74. ai_character_engine-1.0.0/src/ai_character_engine/distributed/models.py +400 -0
  75. ai_character_engine-1.0.0/src/ai_character_engine/distributed/runtime.py +175 -0
  76. ai_character_engine-1.0.0/src/ai_character_engine/evaluation/__init__.py +35 -0
  77. ai_character_engine-1.0.0/src/ai_character_engine/evaluation/__main__.py +31 -0
  78. ai_character_engine-1.0.0/src/ai_character_engine/evaluation/dataset.py +119 -0
  79. ai_character_engine-1.0.0/src/ai_character_engine/evaluation/evaluator.py +234 -0
  80. ai_character_engine-1.0.0/src/ai_character_engine/evaluation/models.py +304 -0
  81. ai_character_engine-1.0.0/src/ai_character_engine/events/__init__.py +3 -0
  82. ai_character_engine-1.0.0/src/ai_character_engine/events/models.py +37 -0
  83. ai_character_engine-1.0.0/src/ai_character_engine/extensions/__init__.py +51 -0
  84. ai_character_engine-1.0.0/src/ai_character_engine/extensions/discovery.py +54 -0
  85. ai_character_engine-1.0.0/src/ai_character_engine/extensions/errors.py +25 -0
  86. ai_character_engine-1.0.0/src/ai_character_engine/extensions/manager.py +85 -0
  87. ai_character_engine-1.0.0/src/ai_character_engine/extensions/models.py +156 -0
  88. ai_character_engine-1.0.0/src/ai_character_engine/extensions/policy.py +33 -0
  89. ai_character_engine-1.0.0/src/ai_character_engine/extensions/protocols.py +18 -0
  90. ai_character_engine-1.0.0/src/ai_character_engine/extensions/registry.py +245 -0
  91. ai_character_engine-1.0.0/src/ai_character_engine/goals/__init__.py +24 -0
  92. ai_character_engine-1.0.0/src/ai_character_engine/goals/manager.py +165 -0
  93. ai_character_engine-1.0.0/src/ai_character_engine/goals/models.py +195 -0
  94. ai_character_engine-1.0.0/src/ai_character_engine/goals/store.py +169 -0
  95. ai_character_engine-1.0.0/src/ai_character_engine/host/__init__.py +3 -0
  96. ai_character_engine-1.0.0/src/ai_character_engine/host/bridge.py +318 -0
  97. ai_character_engine-1.0.0/src/ai_character_engine/live/__init__.py +18 -0
  98. ai_character_engine-1.0.0/src/ai_character_engine/live/models.py +145 -0
  99. ai_character_engine-1.0.0/src/ai_character_engine/live/orchestrator.py +1236 -0
  100. ai_character_engine-1.0.0/src/ai_character_engine/llm/__init__.py +103 -0
  101. ai_character_engine-1.0.0/src/ai_character_engine/llm/base.py +27 -0
  102. ai_character_engine-1.0.0/src/ai_character_engine/llm/deployment.py +339 -0
  103. ai_character_engine-1.0.0/src/ai_character_engine/llm/errors.py +6 -0
  104. ai_character_engine-1.0.0/src/ai_character_engine/llm/gateway.py +542 -0
  105. ai_character_engine-1.0.0/src/ai_character_engine/llm/inference.py +501 -0
  106. ai_character_engine-1.0.0/src/ai_character_engine/llm/local.py +439 -0
  107. ai_character_engine-1.0.0/src/ai_character_engine/llm/models.py +48 -0
  108. ai_character_engine-1.0.0/src/ai_character_engine/llm/provider.py +126 -0
  109. ai_character_engine-1.0.0/src/ai_character_engine/llm/voice_stream.py +156 -0
  110. ai_character_engine-1.0.0/src/ai_character_engine/long_term_cognition/__init__.py +38 -0
  111. ai_character_engine-1.0.0/src/ai_character_engine/long_term_cognition/consolidation.py +228 -0
  112. ai_character_engine-1.0.0/src/ai_character_engine/long_term_cognition/manager.py +82 -0
  113. ai_character_engine-1.0.0/src/ai_character_engine/long_term_cognition/models.py +175 -0
  114. ai_character_engine-1.0.0/src/ai_character_engine/long_term_cognition/store.py +252 -0
  115. ai_character_engine-1.0.0/src/ai_character_engine/memory/__init__.py +138 -0
  116. ai_character_engine-1.0.0/src/ai_character_engine/memory/config.py +20 -0
  117. ai_character_engine-1.0.0/src/ai_character_engine/memory/consolidation.py +204 -0
  118. ai_character_engine-1.0.0/src/ai_character_engine/memory/embedding.py +189 -0
  119. ai_character_engine-1.0.0/src/ai_character_engine/memory/evaluation.py +156 -0
  120. ai_character_engine-1.0.0/src/ai_character_engine/memory/evidence.py +164 -0
  121. ai_character_engine-1.0.0/src/ai_character_engine/memory/hybrid.py +281 -0
  122. ai_character_engine-1.0.0/src/ai_character_engine/memory/ledger.py +127 -0
  123. ai_character_engine-1.0.0/src/ai_character_engine/memory/manager.py +257 -0
  124. ai_character_engine-1.0.0/src/ai_character_engine/memory/models.py +82 -0
  125. ai_character_engine-1.0.0/src/ai_character_engine/memory/policy.py +82 -0
  126. ai_character_engine-1.0.0/src/ai_character_engine/memory/production.py +341 -0
  127. ai_character_engine-1.0.0/src/ai_character_engine/memory/providers.py +59 -0
  128. ai_character_engine-1.0.0/src/ai_character_engine/memory/qdrant.py +331 -0
  129. ai_character_engine-1.0.0/src/ai_character_engine/memory/query.py +78 -0
  130. ai_character_engine-1.0.0/src/ai_character_engine/memory/ranking.py +148 -0
  131. ai_character_engine-1.0.0/src/ai_character_engine/memory/retriever.py +207 -0
  132. ai_character_engine-1.0.0/src/ai_character_engine/memory/revision.py +327 -0
  133. ai_character_engine-1.0.0/src/ai_character_engine/memory/store.py +140 -0
  134. ai_character_engine-1.0.0/src/ai_character_engine/memory/summarizer.py +70 -0
  135. ai_character_engine-1.0.0/src/ai_character_engine/memory/trace.py +64 -0
  136. ai_character_engine-1.0.0/src/ai_character_engine/memory/vector.py +90 -0
  137. ai_character_engine-1.0.0/src/ai_character_engine/multi_character/__init__.py +48 -0
  138. ai_character_engine-1.0.0/src/ai_character_engine/multi_character/errors.py +18 -0
  139. ai_character_engine-1.0.0/src/ai_character_engine/multi_character/models.py +134 -0
  140. ai_character_engine-1.0.0/src/ai_character_engine/multi_character/runtime.py +261 -0
  141. ai_character_engine-1.0.0/src/ai_character_engine/multi_character/scheduler.py +131 -0
  142. ai_character_engine-1.0.0/src/ai_character_engine/multi_character/store.py +212 -0
  143. ai_character_engine-1.0.0/src/ai_character_engine/observability/__init__.py +11 -0
  144. ai_character_engine-1.0.0/src/ai_character_engine/observability/eval.py +85 -0
  145. ai_character_engine-1.0.0/src/ai_character_engine/observability/models.py +99 -0
  146. ai_character_engine-1.0.0/src/ai_character_engine/observability/sink.py +98 -0
  147. ai_character_engine-1.0.0/src/ai_character_engine/observability/tracing.py +78 -0
  148. ai_character_engine-1.0.0/src/ai_character_engine/performance/__init__.py +34 -0
  149. ai_character_engine-1.0.0/src/ai_character_engine/performance/__main__.py +74 -0
  150. ai_character_engine-1.0.0/src/ai_character_engine/performance/budgets.py +143 -0
  151. ai_character_engine-1.0.0/src/ai_character_engine/performance/io.py +19 -0
  152. ai_character_engine-1.0.0/src/ai_character_engine/performance/models.py +288 -0
  153. ai_character_engine-1.0.0/src/ai_character_engine/performance/profiler.py +167 -0
  154. ai_character_engine-1.0.0/src/ai_character_engine/persistence/__init__.py +66 -0
  155. ai_character_engine-1.0.0/src/ai_character_engine/persistence/__main__.py +69 -0
  156. ai_character_engine-1.0.0/src/ai_character_engine/persistence/fixtures.py +95 -0
  157. ai_character_engine-1.0.0/src/ai_character_engine/persistence/io.py +96 -0
  158. ai_character_engine-1.0.0/src/ai_character_engine/persistence/models.py +162 -0
  159. ai_character_engine-1.0.0/src/ai_character_engine/persistence/registry.py +420 -0
  160. ai_character_engine-1.0.0/src/ai_character_engine/production/__init__.py +16 -0
  161. ai_character_engine-1.0.0/src/ai_character_engine/production/models.py +174 -0
  162. ai_character_engine-1.0.0/src/ai_character_engine/production/runtime.py +371 -0
  163. ai_character_engine-1.0.0/src/ai_character_engine/release/__init__.py +51 -0
  164. ai_character_engine-1.0.0/src/ai_character_engine/release/__main__.py +78 -0
  165. ai_character_engine-1.0.0/src/ai_character_engine/release/inspector.py +267 -0
  166. ai_character_engine-1.0.0/src/ai_character_engine/release/matrix.py +28 -0
  167. ai_character_engine-1.0.0/src/ai_character_engine/release/models.py +232 -0
  168. ai_character_engine-1.0.0/src/ai_character_engine/release_candidate/__init__.py +23 -0
  169. ai_character_engine-1.0.0/src/ai_character_engine/release_candidate/__main__.py +88 -0
  170. ai_character_engine-1.0.0/src/ai_character_engine/release_candidate/acceptance.py +184 -0
  171. ai_character_engine-1.0.0/src/ai_character_engine/release_candidate/collector.py +45 -0
  172. ai_character_engine-1.0.0/src/ai_character_engine/release_candidate/evidence.py +106 -0
  173. ai_character_engine-1.0.0/src/ai_character_engine/release_candidate/models.py +140 -0
  174. ai_character_engine-1.0.0/src/ai_character_engine/release_candidate/provenance.py +64 -0
  175. ai_character_engine-1.0.0/src/ai_character_engine/runtime/__init__.py +6 -0
  176. ai_character_engine-1.0.0/src/ai_character_engine/runtime/character_runtime.py +712 -0
  177. ai_character_engine-1.0.0/src/ai_character_engine/runtime/coordination.py +62 -0
  178. ai_character_engine-1.0.0/src/ai_character_engine/runtime/loop.py +69 -0
  179. ai_character_engine-1.0.0/src/ai_character_engine/runtime/models.py +38 -0
  180. ai_character_engine-1.0.0/src/ai_character_engine/service/__init__.py +68 -0
  181. ai_character_engine-1.0.0/src/ai_character_engine/service/app.py +335 -0
  182. ai_character_engine-1.0.0/src/ai_character_engine/service/auth.py +31 -0
  183. ai_character_engine-1.0.0/src/ai_character_engine/service/config.py +22 -0
  184. ai_character_engine-1.0.0/src/ai_character_engine/service/errors.py +58 -0
  185. ai_character_engine-1.0.0/src/ai_character_engine/service/models.py +129 -0
  186. ai_character_engine-1.0.0/src/ai_character_engine/service/service.py +326 -0
  187. ai_character_engine-1.0.0/src/ai_character_engine/service/streaming.py +101 -0
  188. ai_character_engine-1.0.0/src/ai_character_engine/session/__init__.py +41 -0
  189. ai_character_engine-1.0.0/src/ai_character_engine/session/factory.py +139 -0
  190. ai_character_engine-1.0.0/src/ai_character_engine/session/manager.py +172 -0
  191. ai_character_engine-1.0.0/src/ai_character_engine/session/models.py +154 -0
  192. ai_character_engine-1.0.0/src/ai_character_engine/session/runtime.py +99 -0
  193. ai_character_engine-1.0.0/src/ai_character_engine/session/serialization.py +143 -0
  194. ai_character_engine-1.0.0/src/ai_character_engine/session/store.py +151 -0
  195. ai_character_engine-1.0.0/src/ai_character_engine/stability/__init__.py +33 -0
  196. ai_character_engine-1.0.0/src/ai_character_engine/stability/__main__.py +44 -0
  197. ai_character_engine-1.0.0/src/ai_character_engine/stability/injection.py +52 -0
  198. ai_character_engine-1.0.0/src/ai_character_engine/stability/models.py +158 -0
  199. ai_character_engine-1.0.0/src/ai_character_engine/stability/probes.py +74 -0
  200. ai_character_engine-1.0.0/src/ai_character_engine/stability/soak.py +168 -0
  201. ai_character_engine-1.0.0/src/ai_character_engine/state/__init__.py +14 -0
  202. ai_character_engine-1.0.0/src/ai_character_engine/state/models.py +122 -0
  203. ai_character_engine-1.0.0/src/ai_character_engine/state/policy.py +41 -0
  204. ai_character_engine-1.0.0/src/ai_character_engine/state/relationship.py +186 -0
  205. ai_character_engine-1.0.0/src/ai_character_engine/state/rules.py +98 -0
  206. ai_character_engine-1.0.0/src/ai_character_engine/tasks/__init__.py +42 -0
  207. ai_character_engine-1.0.0/src/ai_character_engine/tasks/errors.py +18 -0
  208. ai_character_engine-1.0.0/src/ai_character_engine/tasks/models.py +209 -0
  209. ai_character_engine-1.0.0/src/ai_character_engine/tasks/runtime.py +523 -0
  210. ai_character_engine-1.0.0/src/ai_character_engine/tools/__init__.py +11 -0
  211. ai_character_engine-1.0.0/src/ai_character_engine/tools/errors.py +22 -0
  212. ai_character_engine-1.0.0/src/ai_character_engine/tools/executor.py +101 -0
  213. ai_character_engine-1.0.0/src/ai_character_engine/tools/models.py +44 -0
  214. ai_character_engine-1.0.0/src/ai_character_engine/tools/registry.py +47 -0
  215. ai_character_engine-1.0.0/src/ai_character_engine/tools/validation.py +79 -0
  216. ai_character_engine-1.0.0/src/ai_character_engine/training/__init__.py +37 -0
  217. ai_character_engine-1.0.0/src/ai_character_engine/training/__main__.py +55 -0
  218. ai_character_engine-1.0.0/src/ai_character_engine/training/dataset.py +122 -0
  219. ai_character_engine-1.0.0/src/ai_character_engine/training/gate.py +47 -0
  220. ai_character_engine-1.0.0/src/ai_character_engine/training/huggingface.py +115 -0
  221. ai_character_engine-1.0.0/src/ai_character_engine/training/models.py +233 -0
  222. ai_character_engine-1.0.0/src/ai_character_engine/training/planner.py +30 -0
  223. ai_character_engine-1.0.0/src/ai_character_engine/vision/__init__.py +37 -0
  224. ai_character_engine-1.0.0/src/ai_character_engine/vision/base.py +17 -0
  225. ai_character_engine-1.0.0/src/ai_character_engine/vision/errors.py +14 -0
  226. ai_character_engine-1.0.0/src/ai_character_engine/vision/memory.py +31 -0
  227. ai_character_engine-1.0.0/src/ai_character_engine/vision/models.py +160 -0
  228. ai_character_engine-1.0.0/src/ai_character_engine/vision/pipeline.py +151 -0
  229. ai_character_engine-1.0.0/src/ai_character_engine/vision/providers.py +112 -0
  230. ai_character_engine-1.0.0/src/ai_character_engine/vision/sampling.py +59 -0
  231. ai_character_engine-1.0.0/src/ai_character_engine/vision/validation.py +95 -0
  232. ai_character_engine-1.0.0/src/ai_character_engine/voice/__init__.py +75 -0
  233. ai_character_engine-1.0.0/src/ai_character_engine/voice/acceptance.py +117 -0
  234. ai_character_engine-1.0.0/src/ai_character_engine/voice/base.py +97 -0
  235. ai_character_engine-1.0.0/src/ai_character_engine/voice/devices.py +144 -0
  236. ai_character_engine-1.0.0/src/ai_character_engine/voice/duplex.py +72 -0
  237. ai_character_engine-1.0.0/src/ai_character_engine/voice/gpt_sovits.py +100 -0
  238. ai_character_engine-1.0.0/src/ai_character_engine/voice/live.py +216 -0
  239. ai_character_engine-1.0.0/src/ai_character_engine/voice/loop.py +84 -0
  240. ai_character_engine-1.0.0/src/ai_character_engine/voice/mac_providers.py +200 -0
  241. ai_character_engine-1.0.0/src/ai_character_engine/voice/models.py +96 -0
  242. ai_character_engine-1.0.0/src/ai_character_engine/voice/pipeline.py +269 -0
  243. ai_character_engine-1.0.0/src/ai_character_engine/voice/streaming.py +105 -0
  244. ai_character_engine-1.0.0/src/ai_character_engine/voice/text.py +50 -0
  245. ai_character_engine-1.0.0/src/ai_character_engine/voice/vad.py +113 -0
  246. ai_character_engine-1.0.0/src/ai_character_engine/voice/whisper_worker.py +51 -0
  247. ai_character_engine-1.0.0/src/ai_character_engine/world/__init__.py +50 -0
  248. ai_character_engine-1.0.0/src/ai_character_engine/world/errors.py +17 -0
  249. ai_character_engine-1.0.0/src/ai_character_engine/world/models.py +194 -0
  250. ai_character_engine-1.0.0/src/ai_character_engine/world/perception.py +30 -0
  251. ai_character_engine-1.0.0/src/ai_character_engine/world/runtime.py +228 -0
  252. ai_character_engine-1.0.0/src/ai_character_engine/world/store.py +278 -0
  253. ai_character_engine-1.0.0/src/ai_character_engine.egg-info/PKG-INFO +219 -0
  254. ai_character_engine-1.0.0/src/ai_character_engine.egg-info/SOURCES.txt +256 -0
  255. ai_character_engine-1.0.0/src/ai_character_engine.egg-info/dependency_links.txt +1 -0
  256. ai_character_engine-1.0.0/src/ai_character_engine.egg-info/entry_points.txt +3 -0
  257. ai_character_engine-1.0.0/src/ai_character_engine.egg-info/requires.txt +55 -0
  258. ai_character_engine-1.0.0/src/ai_character_engine.egg-info/top_level.txt +1 -0
@@ -0,0 +1,202 @@
1
+
2
+ Apache License
3
+ Version 2.0, January 2004
4
+ http://www.apache.org/licenses/
5
+
6
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
7
+
8
+ 1. Definitions.
9
+
10
+ "License" shall mean the terms and conditions for use, reproduction,
11
+ and distribution as defined by Sections 1 through 9 of this document.
12
+
13
+ "Licensor" shall mean the copyright owner or entity authorized by
14
+ the copyright owner that is granting the License.
15
+
16
+ "Legal Entity" shall mean the union of the acting entity and all
17
+ other entities that control, are controlled by, or are under common
18
+ control with that entity. For the purposes of this definition,
19
+ "control" means (i) the power, direct or indirect, to cause the
20
+ direction or management of such entity, whether by contract or
21
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
22
+ outstanding shares, or (iii) beneficial ownership of such entity.
23
+
24
+ "You" (or "Your") shall mean an individual or Legal Entity
25
+ exercising permissions granted by this License.
26
+
27
+ "Source" form shall mean the preferred form for making modifications,
28
+ including but not limited to software source code, documentation
29
+ source, and configuration files.
30
+
31
+ "Object" form shall mean any form resulting from mechanical
32
+ transformation or translation of a Source form, including but
33
+ not limited to compiled object code, generated documentation,
34
+ and conversions to other media types.
35
+
36
+ "Work" shall mean the work of authorship, whether in Source or
37
+ Object form, made available under the License, as indicated by a
38
+ copyright notice that is included in or attached to the work
39
+ (an example is provided in the Appendix below).
40
+
41
+ "Derivative Works" shall mean any work, whether in Source or Object
42
+ form, that is based on (or derived from) the Work and for which the
43
+ editorial revisions, annotations, elaborations, or other modifications
44
+ represent, as a whole, an original work of authorship. For the purposes
45
+ of this License, Derivative Works shall not include works that remain
46
+ separable from, or merely link (or bind by name) to the interfaces of,
47
+ the Work and Derivative Works thereof.
48
+
49
+ "Contribution" shall mean any work of authorship, including
50
+ the original version of the Work and any modifications or additions
51
+ to that Work or Derivative Works thereof, that is intentionally
52
+ submitted to Licensor for inclusion in the Work by the copyright owner
53
+ or by an individual or Legal Entity authorized to submit on behalf of
54
+ the copyright owner. For the purposes of this definition, "submitted"
55
+ means any form of electronic, verbal, or written communication sent
56
+ to the Licensor or its representatives, including but not limited to
57
+ communication on electronic mailing lists, source code control systems,
58
+ and issue tracking systems that are managed by, or on behalf of, the
59
+ Licensor for the purpose of discussing and improving the Work, but
60
+ excluding communication that is conspicuously marked or otherwise
61
+ designated in writing by the copyright owner as "Not a Contribution."
62
+
63
+ "Contributor" shall mean Licensor and any individual or Legal Entity
64
+ on behalf of whom a Contribution has been received by Licensor and
65
+ subsequently incorporated within the Work.
66
+
67
+ 2. Grant of Copyright License. Subject to the terms and conditions of
68
+ this License, each Contributor hereby grants to You a perpetual,
69
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
70
+ copyright license to reproduce, prepare Derivative Works of,
71
+ publicly display, publicly perform, sublicense, and distribute the
72
+ Work and such Derivative Works in Source or Object form.
73
+
74
+ 3. Grant of Patent License. Subject to the terms and conditions of
75
+ this License, each Contributor hereby grants to You a perpetual,
76
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
77
+ (except as stated in this section) patent license to make, have made,
78
+ use, offer to sell, sell, import, and otherwise transfer the Work,
79
+ where such license applies only to those patent claims licensable
80
+ by such Contributor that are necessarily infringed by their
81
+ Contribution(s) alone or by combination of their Contribution(s)
82
+ with the Work to which such Contribution(s) was submitted. If You
83
+ institute patent litigation against any entity (including a
84
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
85
+ or a Contribution incorporated within the Work constitutes direct
86
+ or contributory patent infringement, then any patent licenses
87
+ granted to You under this License for that Work shall terminate
88
+ as of the date such litigation is filed.
89
+
90
+ 4. Redistribution. You may reproduce and distribute copies of the
91
+ Work or Derivative Works thereof in any medium, with or without
92
+ modifications, and in Source or Object form, provided that You
93
+ meet the following conditions:
94
+
95
+ (a) You must give any other recipients of the Work or
96
+ Derivative Works a copy of this License; and
97
+
98
+ (b) You must cause any modified files to carry prominent notices
99
+ stating that You changed the files; and
100
+
101
+ (c) You must retain, in the Source form of any Derivative Works
102
+ that You distribute, all copyright, patent, trademark, and
103
+ attribution notices from the Source form of the Work,
104
+ excluding those notices that do not pertain to any part of
105
+ the Derivative Works; and
106
+
107
+ (d) If the Work includes a "NOTICE" text file as part of its
108
+ distribution, then any Derivative Works that You distribute must
109
+ include a readable copy of the attribution notices contained
110
+ within such NOTICE file, excluding those notices that do not
111
+ pertain to any part of the Derivative Works, in at least one
112
+ of the following places: within a NOTICE text file distributed
113
+ as part of the Derivative Works; within the Source form or
114
+ documentation, if provided along with the Derivative Works; or,
115
+ within a display generated by the Derivative Works, if and
116
+ wherever such third-party notices normally appear. The contents
117
+ of the NOTICE file are for informational purposes only and
118
+ do not modify the License. You may add Your own attribution
119
+ notices within Derivative Works that You distribute, alongside
120
+ or as an addendum to the NOTICE text from the Work, provided
121
+ that such additional attribution notices cannot be construed
122
+ as modifying the License.
123
+
124
+ You may add Your own copyright statement to Your modifications and
125
+ may provide additional or different license terms and conditions
126
+ for use, reproduction, or distribution of Your modifications, or
127
+ for any such Derivative Works as a whole, provided Your use,
128
+ reproduction, and distribution of the Work otherwise complies with
129
+ the conditions stated in this License.
130
+
131
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
132
+ any Contribution intentionally submitted for inclusion in the Work
133
+ by You to the Licensor shall be under the terms and conditions of
134
+ this License, without any additional terms or conditions.
135
+ Notwithstanding the above, nothing herein shall supersede or modify
136
+ the terms of any separate license agreement you may have executed
137
+ with Licensor regarding such Contributions.
138
+
139
+ 6. Trademarks. This License does not grant permission to use the trade
140
+ names, trademarks, service marks, or product names of the Licensor,
141
+ except as required for reasonable and customary use in describing the
142
+ origin of the Work and reproducing the content of the NOTICE file.
143
+
144
+ 7. Disclaimer of Warranty. Unless required by applicable law or
145
+ agreed to in writing, Licensor provides the Work (and each
146
+ Contributor provides its Contributions) on an "AS IS" BASIS,
147
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
148
+ implied, including, without limitation, any warranties or conditions
149
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
150
+ PARTICULAR PURPOSE. You are solely responsible for determining the
151
+ appropriateness of using or redistributing the Work and assume any
152
+ risks associated with Your exercise of permissions under this License.
153
+
154
+ 8. Limitation of Liability. In no event and under no legal theory,
155
+ whether in tort (including negligence), contract, or otherwise,
156
+ unless required by applicable law (such as deliberate and grossly
157
+ negligent acts) or agreed to in writing, shall any Contributor be
158
+ liable to You for damages, including any direct, indirect, special,
159
+ incidental, or consequential damages of any character arising as a
160
+ result of this License or out of the use or inability to use the
161
+ Work (including but not limited to damages for loss of goodwill,
162
+ work stoppage, computer failure or malfunction, or any and all
163
+ other commercial damages or losses), even if such Contributor
164
+ has been advised of the possibility of such damages.
165
+
166
+ 9. Accepting Warranty or Additional Liability. While redistributing
167
+ the Work or Derivative Works thereof, You may choose to offer,
168
+ and charge a fee for, acceptance of support, warranty, indemnity,
169
+ or other liability obligations and/or rights consistent with this
170
+ License. However, in accepting such obligations, You may act only
171
+ on Your own behalf and on Your sole responsibility, not on behalf
172
+ of any other Contributor, and only if You agree to indemnify,
173
+ defend, and hold each Contributor harmless for any liability
174
+ incurred by, or claims asserted against, such Contributor by reason
175
+ of your accepting any such warranty or additional liability.
176
+
177
+ END OF TERMS AND CONDITIONS
178
+
179
+ APPENDIX: How to apply the Apache License to your work.
180
+
181
+ To apply the Apache License to your work, attach the following
182
+ boilerplate notice, with the fields enclosed by brackets "[]"
183
+ replaced with your own identifying information. (Don't include
184
+ the brackets!) The text should be enclosed in the appropriate
185
+ comment syntax for the file format. We also recommend that a
186
+ file or class name and description of purpose be included on the
187
+ same "printed page" as the copyright notice for easier
188
+ identification within third-party archives.
189
+
190
+ Copyright [yyyy] [name of copyright owner]
191
+
192
+ Licensed under the Apache License, Version 2.0 (the "License");
193
+ you may not use this file except in compliance with the License.
194
+ You may obtain a copy of the License at
195
+
196
+ http://www.apache.org/licenses/LICENSE-2.0
197
+
198
+ Unless required by applicable law or agreed to in writing, software
199
+ distributed under the License is distributed on an "AS IS" BASIS,
200
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
201
+ See the License for the specific language governing permissions and
202
+ limitations under the License.
@@ -0,0 +1,6 @@
1
+ include README.md README.*.md LICENSE
2
+ prune tests
3
+ prune examples
4
+ global-exclude *.pyc *.pyo .DS_Store
5
+ recursive-include docs/assets *.svg
6
+ recursive-include skills/ai-character-engine *.md *.yaml
@@ -0,0 +1,219 @@
1
+ Metadata-Version: 2.4
2
+ Name: ai-character-engine
3
+ Version: 1.0.0
4
+ Summary: A modular open-source engine for building stateful LLM-powered characters.
5
+ License-Expression: Apache-2.0
6
+ Project-URL: Repository, https://github.com/weryk153/ai-character-engine
7
+ Project-URL: Documentation, https://github.com/weryk153/ai-character-engine/blob/main/docs/README.md
8
+ Requires-Python: >=3.11
9
+ Description-Content-Type: text/markdown
10
+ License-File: LICENSE
11
+ Requires-Dist: openai>=1.0.0
12
+ Requires-Dist: python-dotenv>=1.0.0
13
+ Provides-Extra: dev
14
+ Requires-Dist: pytest>=8.0; extra == "dev"
15
+ Requires-Dist: pytest-asyncio>=0.23; extra == "dev"
16
+ Requires-Dist: httpx<1,>=0.27; extra == "dev"
17
+ Requires-Dist: tzdata>=2024.1; sys_platform == "win32" and extra == "dev"
18
+ Provides-Extra: service
19
+ Requires-Dist: fastapi<1,>=0.115; extra == "service"
20
+ Requires-Dist: uvicorn<1,>=0.30; extra == "service"
21
+ Requires-Dist: pydantic<3,>=2.7; extra == "service"
22
+ Provides-Extra: qdrant
23
+ Requires-Dist: qdrant-client<2,>=1.10; extra == "qdrant"
24
+ Provides-Extra: local
25
+ Requires-Dist: httpx<1,>=0.27; extra == "local"
26
+ Provides-Extra: voice-audio
27
+ Requires-Dist: sounddevice<0.6,>=0.5; extra == "voice-audio"
28
+ Requires-Dist: httpx<1,>=0.27; extra == "voice-audio"
29
+ Provides-Extra: voice-sherpa
30
+ Requires-Dist: httpx<1,>=0.27; extra == "voice-sherpa"
31
+ Requires-Dist: sounddevice<0.6,>=0.5; extra == "voice-sherpa"
32
+ Requires-Dist: sherpa-onnx==1.13.8; extra == "voice-sherpa"
33
+ Requires-Dist: sherpa-onnx-core==1.13.8; sys_platform == "darwin" and extra == "voice-sherpa"
34
+ Requires-Dist: numpy<3,>=1.26; extra == "voice-sherpa"
35
+ Provides-Extra: voice-mac
36
+ Requires-Dist: httpx<1,>=0.27; extra == "voice-mac"
37
+ Requires-Dist: sounddevice<0.6,>=0.5; extra == "voice-mac"
38
+ Requires-Dist: faster-whisper<2,>=1.1; extra == "voice-mac"
39
+ Requires-Dist: numpy<3,>=1.26; extra == "voice-mac"
40
+ Provides-Extra: training
41
+ Requires-Dist: datasets<5,>=3; extra == "training"
42
+ Requires-Dist: transformers<6,>=4.48; extra == "training"
43
+ Requires-Dist: peft<1,>=0.14; extra == "training"
44
+ Requires-Dist: trl<2,>=0.15; extra == "training"
45
+ Requires-Dist: accelerate<2,>=1; extra == "training"
46
+ Provides-Extra: training-qlora
47
+ Requires-Dist: datasets<5,>=3; extra == "training-qlora"
48
+ Requires-Dist: transformers<6,>=4.48; extra == "training-qlora"
49
+ Requires-Dist: peft<1,>=0.14; extra == "training-qlora"
50
+ Requires-Dist: trl<2,>=0.15; extra == "training-qlora"
51
+ Requires-Dist: accelerate<2,>=1; extra == "training-qlora"
52
+ Requires-Dist: bitsandbytes<1,>=0.45; extra == "training-qlora"
53
+ Dynamic: license-file
54
+
55
+ <p align="center">
56
+ <img src="docs/assets/readme-banner.svg" alt="AI Character Engine — A Python SDK for characters with memory, goals and tools" width="100%" />
57
+ </p>
58
+
59
+ <h1 align="center">AI Character Engine</h1>
60
+
61
+ <p align="center"><strong>A Python SDK for AI characters with memory, tools and ongoing conversations.</strong></p>
62
+
63
+ <p align="center">
64
+ <a href="pyproject.toml"><img src="docs/assets/badge-version.svg" alt="Version 1.0.0" /></a>
65
+ <a href="LICENSE"><img src="docs/assets/badge-license.svg" alt="License: Apache-2.0" /></a>
66
+ <a href="docs/getting-started.md"><img src="docs/assets/badge-python.svg" alt="Python 3.11–3.13" /></a>
67
+ <a href="https://github.com/weryk153/ai-character-engine/actions/workflows/ci.yml"><img src="docs/assets/badge-platforms.svg" alt="Linux, macOS, Windows" /></a>
68
+ </p>
69
+
70
+ <blockquote>
71
+ <p align="center"><strong>Build companions, game NPCs and virtual assistants with a shared character runtime.</strong></p>
72
+ </blockquote>
73
+
74
+ <p align="center">
75
+ <strong><a href="README.md">English</a> &nbsp;|&nbsp; <a href="README.zh-TW.md">繁體中文</a> &nbsp;|&nbsp; <a href="README.zh-CN.md">简体中文</a> &nbsp;|&nbsp; <a href="README.ja.md">日本語</a> &nbsp;|&nbsp; <a href="README.ko.md">한국어</a><br />
76
+ <a href="README.es.md">Español</a> &nbsp;|&nbsp; <a href="README.fr.md">Français</a> &nbsp;|&nbsp; <a href="README.de.md">Deutsch</a> &nbsp;|&nbsp; <a href="README.pt-BR.md">Português (Brasil)</a></strong>
77
+ </p>
78
+
79
+ <p align="center">
80
+ <strong><a href="docs/README.md">Documentation</a> &nbsp;|&nbsp; <a href="docs/getting-started.md">Installation</a> &nbsp;|&nbsp; <a href="examples/README.md">Examples</a> &nbsp;|&nbsp; <a href="docs/architecture.md">Architecture</a> &nbsp;|&nbsp; <a href="skills/ai-character-engine/SKILL.md">Agent Skill</a></strong>
81
+ </p>
82
+
83
+ ---
84
+
85
+ ## About
86
+
87
+ AI Character Engine helps you build AI companions, game NPCs and virtual assistants. Give a character a personality, let it remember interactions and keep track of unfinished work, then connect tools so it can act inside your application.
88
+
89
+ The engine manages the character’s data: conversations and long-term memories, emotion and relationship state, reflections, beliefs and ongoing goals. The model generates responses. Character records live outside the model, where you can inspect, revise and persist them, and keep using them when you change models.
90
+
91
+ Start with text chat or connect the engine to an existing desktop character, voice interface or game. The core works independently of any particular model or renderer; the VRM adapter is an optional package. Supports Linux, macOS and Windows with Python 3.11–3.13.
92
+
93
+ ## ✨ Features
94
+
95
+ ### 🧠 Memory and character state
96
+
97
+ - **Long-term memory:** Store useful moments from interactions and retrieve memories relevant to the current conversation. Includes correction, consolidation and forgetting.
98
+ - **Reflection and beliefs:** Build interpretations from past events and keep their supporting evidence. Insufficient or conflicting evidence has its own handling; repeating a model output does not turn it into a fact.
99
+ - **Emotion and relationships:** Track emotion, energy, trust, favorability and relationship stage. Your policies decide how interactions update them.
100
+ - **Saved sessions:** Save and restore conversation and relationship data so users can pick up where they left off.
101
+
102
+ ### 🎯 Goals and actions
103
+
104
+ - **Ongoing goals:** Track what the character is working on, its motivation, and active, blocked, paused or completed status. Goals can remain after the topic changes.
105
+ - **Tool calls:** Register data lookups, game-state queries or application actions as tools the model can use during a turn. Your app owns the handlers and permissions.
106
+ - **Proactive interaction:** The autonomy host provides triggers and scheduling for interactions under your configured conditions. You supply the allowed actions and timing policies.
107
+
108
+ ### ⚡ Background cognition and multiple models
109
+
110
+ - **Chat while processing experience:** Foreground turns handle conversation while background tasks summarize, reflect or perform other work, with concurrency limits, timeouts and cancellation.
111
+ - **Models by role:** Dialogue, summary, reflection and vision can share one model or use different endpoints with configured fallback.
112
+ - **Specialist collaboration:** An optional planner, specialists and verifier flow delegates a bounded task to different roles and collects their results.
113
+
114
+ ### 🌍 Multiple characters and world interaction
115
+
116
+ - **Individual memories and perspectives:** Characters keep separate state and cognitive records, communicating through explicit messages.
117
+ - **Observations by character:** Perception rules determine who receives a world event. An NPC that sees a door open can receive that observation without making every other NPC aware of it.
118
+ - **Connect your world:** Interfaces cover world state, events and observations. Movement, physics and rendering stay in your application.
119
+
120
+ ### 🎙️ Voice, vision and avatars
121
+
122
+ - **Live input:** Feed text and normalized visual or audio observations into the live runtime.
123
+ - **Voice conversations:** Interfaces and integration flows cover recognition, streaming synthesis, playback and interruption. Configure providers and devices before use.
124
+ - **Expression and lip-sync:** Produce expression, behavior and lip-sync cues for your host to map to its character model. The VRM adapter provides an optional connection.
125
+
126
+ Also included: event traces, persistence replay, cognitive evaluation, HTTP/SSE/WebSocket service interfaces and offline SFT/LoRA training tools. These modules are optional. Start with a text character and add the pieces you need.
127
+
128
+ ## 🏗️ Architecture
129
+
130
+ `CharacterRuntime` is the entry point for one character. It assembles context, calls models and tools, and records the turn’s result. Profile, current state, memory, beliefs and goals are stored separately and included within their context budgets.
131
+
132
+ ```mermaid
133
+ flowchart TD
134
+ App["Your app, game or character interface"] <--> Runtime["CharacterRuntime"]
135
+ Context["Profile · State · Memory · Beliefs · Goals"] --> Runtime
136
+ Runtime <--> Models["Models and cognitive-role routing"]
137
+ Runtime <--> Tools["Application tools"]
138
+ Runtime --> Record["Turn recording and state updates"]
139
+ Record --> Context
140
+ Runtime --> Snapshot["Read-only snapshot"]
141
+ Snapshot --> Workers["Background summaries, reflection and cognition"]
142
+ Workers --> Commit["Proposal validation and commit"]
143
+ Commit --> Context
144
+ ```
145
+
146
+ Background workers operate on snapshots. Their proposals are checked for provenance and revision before being committed, so an old task cannot simply overwrite newer character state. Models, speech services and renderers connect through interfaces; the runtime and commit flow coordinate writes to character data.
147
+
148
+ The [architecture guide](docs/architecture.md) covers foreground/background flows, character isolation, world perception and extension interfaces.
149
+
150
+ ## 🚀 Quick start
151
+
152
+ You need **Python 3.11–3.13**.
153
+
154
+ ```sh
155
+ git clone https://github.com/weryk153/ai-character-engine.git
156
+ cd ai-character-engine
157
+ python -m venv .venv
158
+ ```
159
+
160
+ Activate the environment with `source .venv/bin/activate` on macOS/Linux or `.venv\Scripts\Activate.ps1` in Windows PowerShell, then install:
161
+
162
+ ```sh
163
+ python -m pip install .
164
+ ```
165
+
166
+ Start a local OpenAI-compatible model server, such as LM Studio. Replace `your-loaded-model` below with the loaded model’s identifier and adjust the URL to your server. Both calls use the same character, so the second receives the earlier exchange.
167
+
168
+ ```python
169
+ import asyncio
170
+ from ai_character_engine import CharacterProfile, CharacterRuntime
171
+ from ai_character_engine.llm.local import OpenAICompatibleChatClient
172
+
173
+ async def main():
174
+ llm = OpenAICompatibleChatClient(
175
+ base_url="http://127.0.0.1:1234/v1",
176
+ model="your-loaded-model",
177
+ )
178
+ character = CharacterRuntime(
179
+ character=CharacterProfile(
180
+ id="mei", name="Mei",
181
+ description="A friendly companion who gives concise answers.",
182
+ ),
183
+ llm=llm,
184
+ )
185
+ try:
186
+ print((await character.run_turn("Call me Alex.")).text)
187
+ print((await character.run_turn("What name did I ask you to use?")).text)
188
+ finally:
189
+ await llm.client.close()
190
+
191
+ asyncio.run(main())
192
+ ```
193
+
194
+ This example uses conversation history. For continuity across restarts, add [session save/restore](examples/session_runtime.py). Long-term memory, reflection and goals require their own configuration. See the [installation guide](docs/getting-started.md) for the full setup.
195
+
196
+ A host that talks to one character — a chat window, a voice application, a desktop avatar — can skip that configuration: [`CharacterCompanion`](docs/companion.md) is the engine assembled with memory, mood, goals, reflection and interruption already wired, behind a single `reply()`. Its context is written into the conversation as it grows, so a local model’s prompt cache stays usable from turn to turn. See [`examples/companion_chat.py`](examples/companion_chat.py).
197
+
198
+ ## 🔌 Models and integrations
199
+
200
+ - **LLMs:** OpenAI Responses and OpenAI-compatible Chat Completions, including compatible LM Studio, Ollama and vLLM endpoints. You can also implement your own client. See [provider examples](examples/README.md).
201
+ - **Voice and avatars:** Install audio extras or the [VRM adapter](packages/renderer-vrm/README.md) as needed. Installing a package does not download models or start services.
202
+ - **Local or remote:** The core does not require a cloud service or API key. Local models can use local endpoints; your chosen providers and tools determine network use.
203
+
204
+ ## 📂 Examples and docs
205
+
206
+ - [Character companion](examples/companion_chat.py): a terminal chat with one character that remembers what you tell it and changes over time, on a local OpenAI-compatible endpoint.
207
+ - [Interactive chat](examples/basic_chat.py) / [tool calls](examples/tool_chat.py): configure the model and credentials in `.env` before running.
208
+ - [Sessions](examples/session_runtime.py): save and restore using temporary storage and an offline client.
209
+ - [HTTP/SSE/WebSocket](examples/character_service.py): a service example for web or mobile clients. Uses an offline client by default; configure inference and authentication for deployment.
210
+ - [Autonomy](examples/autonomy_host.py): integrate character triggers and lifecycle.
211
+ - [Memory revision](tests/scenarios/memory_revision.py), [reflection and beliefs](tests/scenarios/reflection_long_term_cognition.py), [goals](tests/scenarios/goal_motivation_runtime.py), [world perception](tests/scenarios/world_environment.py): executable regression scenarios showing cognitive configuration and expected results.
212
+
213
+ [API reference](docs/api-reference.md) · [Configuration](docs/configuration.md) · [Deployment and operations](docs/operations.md) · [Extensions](docs/extensions.md)
214
+
215
+ ## Development and license
216
+
217
+ Current version: **1.0.0**. CI covers Linux/macOS/Windows × Python 3.11/3.12/3.13, plus API compatibility, persistence replay, failure injection, same-environment performance and package installation. See [CI](https://github.com/weryk153/ai-character-engine/actions/workflows/ci.yml), [validation](VALIDATION.md) and [compatibility](docs/compatibility.md).
218
+
219
+ Issues and fixes are welcome; see [CONTRIBUTING](CONTRIBUTING.md). Licensed under [Apache-2.0](LICENSE). Third-party models, voices and assets retain their own licenses.
@@ -0,0 +1,165 @@
1
+ <p align="center">
2
+ <img src="docs/assets/readme-banner.svg" alt="AI Character Engine — A Python SDK for characters with memory, goals and tools" width="100%" />
3
+ </p>
4
+
5
+ <h1 align="center">AI Character Engine</h1>
6
+
7
+ <p align="center"><strong>Ein Python-SDK für KI-Charaktere mit Gedächtnis, Werkzeugen und fortlaufenden Gesprächen.</strong></p>
8
+
9
+ <p align="center">
10
+ <a href="pyproject.toml"><img src="docs/assets/badge-version.svg" alt="Version 1.0.0" /></a>
11
+ <a href="LICENSE"><img src="docs/assets/badge-license.svg" alt="License: Apache-2.0" /></a>
12
+ <a href="docs/getting-started.md"><img src="docs/assets/badge-python.svg" alt="Python 3.11–3.13" /></a>
13
+ <a href="https://github.com/weryk153/ai-character-engine/actions/workflows/ci.yml"><img src="docs/assets/badge-platforms.svg" alt="Linux, macOS, Windows" /></a>
14
+ </p>
15
+
16
+ <blockquote>
17
+ <p align="center"><strong>Entwickle KI-Begleiter, NPCs und virtuelle Assistenten mit einer gemeinsamen Charakter-Runtime.</strong></p>
18
+ </blockquote>
19
+
20
+ <p align="center">
21
+ <strong><a href="README.md">English</a> &nbsp;|&nbsp; <a href="README.zh-TW.md">繁體中文</a> &nbsp;|&nbsp; <a href="README.zh-CN.md">简体中文</a> &nbsp;|&nbsp; <a href="README.ja.md">日本語</a> &nbsp;|&nbsp; <a href="README.ko.md">한국어</a><br />
22
+ <a href="README.es.md">Español</a> &nbsp;|&nbsp; <a href="README.fr.md">Français</a> &nbsp;|&nbsp; <a href="README.de.md">Deutsch</a> &nbsp;|&nbsp; <a href="README.pt-BR.md">Português (Brasil)</a></strong>
23
+ </p>
24
+
25
+ <p align="center">
26
+ <strong><a href="docs/README.md">Dokumentation</a> &nbsp;|&nbsp; <a href="docs/getting-started.md">Installation</a> &nbsp;|&nbsp; <a href="examples/README.md">Beispiele</a> &nbsp;|&nbsp; <a href="docs/architecture.md">Architektur</a> &nbsp;|&nbsp; <a href="skills/ai-character-engine/SKILL.md">Agent Skill</a></strong>
27
+ </p>
28
+
29
+ ---
30
+
31
+ ## Über das Projekt
32
+
33
+ Mit AI Character Engine entwickelst du KI-Begleiter, NPCs und virtuelle Assistenten. Gib ihnen eine Persönlichkeit, lass sie sich an Interaktionen erinnern und offene Aufgaben verfolgen. Über Werkzeuge können sie in deiner Anwendung handeln.
34
+
35
+ Die Engine verwaltet Gespräche, Langzeitgedächtnis, Emotionen, Beziehungen, Reflexionen, Überzeugungen und Ziele. Das Modell erzeugt Antworten. Charakterdaten liegen außerhalb des Modells: Du kannst sie prüfen, korrigieren, speichern und nach einem Modellwechsel weiterverwenden.
36
+
37
+ Beginne mit Textchat oder integriere die Engine in einen Desktop-Charakter, eine Sprachoberfläche oder ein Spiel. Der Kern ist unabhängig von einem bestimmten Modell oder Renderer. Der VRM-Adapter ist optional. Unterstützt Linux, macOS und Windows mit Python 3.11–3.13.
38
+
39
+ ## ✨ Funktionen
40
+
41
+ ### 🧠 Gedächtnis und Charakterzustand
42
+
43
+ - **Langzeitgedächtnis:** Speichert relevante Erlebnisse und ruft zum aktuellen Thema passende Erinnerungen ab. Mit Korrektur, Konsolidierung und Vergessen.
44
+ - **Reflexion und Überzeugungen:** Ordnet Deutungen vergangener Ereignisse und behält ihre Belege. Unzureichende und widersprüchliche Belege werden gesondert behandelt; Modellwiederholungen erzeugen keine Tatsachen.
45
+ - **Emotionen und Beziehungen:** Verwaltet Emotion, Energie, Vertrauen, Zuneigung und Beziehungsphase. Deine Regeln bestimmen, wie sie sich ändern.
46
+ - **Gespeicherte Sitzungen:** Speichert Gespräche und Beziehungsdaten und stellt sie wieder her, für den nächsten Besuch.
47
+
48
+ ### 🎯 Ziele und Handlungen
49
+
50
+ - **Fortbestehende Ziele:** Hält Aufgaben, Motivation sowie aktiven, blockierten, pausierten oder abgeschlossenen Status fest, auch nach einem Themenwechsel.
51
+ - **Werkzeugaufrufe:** Registriere Datenabfragen, Spielzustandsabfragen oder Anwendungsaktionen. Implementierung und Berechtigungen liegen bei deiner App.
52
+ - **Proaktive Interaktion:** Der Autonomie-Host bietet Auslöser und Zeitplanung. Erlaubte Aktionen und Ausführungszeitpunkte konfigurierst du.
53
+
54
+ ### ⚡ Hintergrundkognition und mehrere Modelle
55
+
56
+ - **Sprechen und Erfahrungen verarbeiten:** Gesprächsrunden im Vordergrund, Zusammenfassungen und Reflexionen im Hintergrund, mit Parallelitätsgrenzen, Zeitlimits und Abbruch.
57
+ - **Modelle nach Rolle:** Dialog, Zusammenfassung, Reflexion und Bildverarbeitung können ein Modell teilen oder verschiedene Endpunkte mit konfiguriertem Fallback nutzen.
58
+ - **Spezialisten:** Ein optionaler Ablauf aus Planer, Spezialisten und Prüfer verteilt eine begrenzte Aufgabe und sammelt Ergebnisse.
59
+
60
+ ### 🌍 Mehrere Charaktere und Weltinteraktion
61
+
62
+ - **Eigene Erinnerungen und Sichtweisen:** Jeder Charakter behält seinen Zustand und seine Kognitionsdaten. Die Kommunikation erfolgt durch ausdrückliche Nachrichten.
63
+ - **Beobachtungen nach Charakter:** Wahrnehmungsregeln bestimmen die Empfänger von Weltereignissen. Ein NPC kann beobachten, wie sich eine Tür öffnet, ohne dass alle anderen davon wissen.
64
+ - **Deine Welt anbinden:** Schnittstellen für Weltzustand, Ereignisse und Beobachtungen. Bewegung, Physik und Darstellung bleiben beim Host.
65
+
66
+ ### 🎙️ Sprache, Bild und Avatare
67
+
68
+ - **Live-Eingabe:** Text und normalisierte Bild- oder Audiobeobachtungen an die Live-Runtime übergeben.
69
+ - **Sprachgespräche:** Schnittstellen und Abläufe für Erkennung, Streaming-Synthese, Wiedergabe und Unterbrechung. Anbieter und Geräte müssen eingerichtet sein.
70
+ - **Mimik und Lippensynchronisation:** Erzeugt Ausdrucks-, Verhaltens- und Mundbewegungssignale für das Charaktermodell des Hosts. Der VRM-Adapter ist optional.
71
+
72
+ Außerdem enthalten: Ereignis-Traces, Persistenz-Replay, Kognitionsevaluation, HTTP/SSE/WebSocket-Services sowie SFT/LoRA-Werkzeuge für Offline-Training. Die Module sind optional. Starte mit Text und ergänze die benötigten Teile.
73
+
74
+ ## 🏗️ Architektur
75
+
76
+ `CharacterRuntime` ist der Einstiegspunkt für einen Charakter. Die Runtime baut Kontext auf, ruft Modelle und Werkzeuge auf und zeichnet das Ergebnis auf. Profil, Zustand, Gedächtnis, Überzeugungen und Ziele werden getrennt gespeichert und innerhalb ihrer Kontextbudgets eingebunden.
77
+
78
+ ```mermaid
79
+ flowchart TD
80
+ App["Anwendung, Spiel oder Charakteroberfläche"] <--> Runtime["CharacterRuntime"]
81
+ Context["Profil · Zustand · Gedächtnis · Überzeugungen · Ziele"] --> Runtime
82
+ Runtime <--> Models["Modelle und Routing kognitiver Rollen"]
83
+ Runtime <--> Tools["Anwendungswerkzeuge"]
84
+ Runtime --> Record["Rundenaufzeichnung und Zustandsänderung"]
85
+ Record --> Context
86
+ Runtime --> Snapshot["Schreibgeschützte Momentaufnahme"]
87
+ Snapshot --> Workers["Zusammenfassung, Reflexion und Hintergrundkognition"]
88
+ Workers --> Commit["Vorschlagsprüfung und Commit"]
89
+ Commit --> Context
90
+ ```
91
+
92
+ Hintergrund-Worker arbeiten mit Momentaufnahmen. Herkunft und Revision werden vor dem Commit geprüft, damit eine alte Aufgabe keinen neueren Zustand einfach überschreibt. Modelle, Sprachdienste und Renderer werden über Schnittstellen angebunden; Runtime und Commit-Ablauf koordinieren Schreibzugriffe.
93
+
94
+ Der [Architekturleitfaden](docs/architecture.md) beschreibt Datenflüsse, Charaktertrennung, Weltwahrnehmung und Erweiterungen.
95
+
96
+ ## 🚀 Schnellstart
97
+
98
+ Du brauchst **Python 3.11–3.13**.
99
+
100
+ ```sh
101
+ git clone https://github.com/weryk153/ai-character-engine.git
102
+ cd ai-character-engine
103
+ python -m venv .venv
104
+ ```
105
+
106
+ Aktiviere die Umgebung mit `source .venv/bin/activate` unter macOS/Linux oder `.venv\Scripts\Activate.ps1` in Windows PowerShell. Danach installieren:
107
+
108
+ ```sh
109
+ python -m pip install .
110
+ ```
111
+
112
+ Starte einen lokalen OpenAI-kompatiblen Modellserver, etwa LM Studio. Ersetze `your-loaded-model` durch die Kennung des geladenen Modells und passe die URL an. Beide Aufrufe verwenden denselben Charakter; der zweite erhält den vorherigen Austausch.
113
+
114
+ ```python
115
+ import asyncio
116
+ from ai_character_engine import CharacterProfile, CharacterRuntime
117
+ from ai_character_engine.llm.local import OpenAICompatibleChatClient
118
+
119
+ async def main():
120
+ llm = OpenAICompatibleChatClient(
121
+ base_url="http://127.0.0.1:1234/v1",
122
+ model="your-loaded-model",
123
+ )
124
+ character = CharacterRuntime(
125
+ character=CharacterProfile(
126
+ id="mei", name="Mei",
127
+ description="A friendly companion who gives concise answers.",
128
+ ),
129
+ llm=llm,
130
+ )
131
+ try:
132
+ print((await character.run_turn("Call me Alex.")).text)
133
+ print((await character.run_turn("What name did I ask you to use?")).text)
134
+ finally:
135
+ await llm.client.close()
136
+
137
+ asyncio.run(main())
138
+ ```
139
+
140
+ Das Beispiel nutzt den Gesprächsverlauf. Für die Fortsetzung nach einem Neustart ergänze [Sitzungsspeicherung](examples/session_runtime.py). Langzeitgedächtnis, Reflexion und Ziele werden separat konfiguriert. Siehe [Installationsanleitung](docs/getting-started.md).
141
+
142
+ Ein Host, der mit einem einzigen Charakter spricht – ein Chatfenster, eine Sprachanwendung, ein Desktop-Avatar –, kann sich diese Konfiguration sparen: [`CharacterCompanion`](docs/companion.md) ist die Engine, in der Gedächtnis, Stimmung, Ziele, Reflexion und Unterbrechung bereits verdrahtet sind, hinter einem einzigen `reply()`. Ihr Kontext wird fortlaufend in das Gespräch geschrieben, sodass der Prompt-Cache eines lokalen Modells von Runde zu Runde nutzbar bleibt. Siehe [`examples/companion_chat.py`](examples/companion_chat.py).
143
+
144
+ ## 🔌 Modelle und Integrationen
145
+
146
+ - **LLM:** OpenAI Responses und OpenAI-kompatible Chat Completions, darunter kompatible Endpunkte von LM Studio, Ollama und vLLM. Eigene Clients sind ebenfalls möglich. [Provider-Beispiele](examples/README.md).
147
+ - **Sprache und Avatare:** Audio-Extras und [VRM-Adapter](packages/renderer-vrm/README.md) nach Bedarf. Paketinstallation lädt keine Modelle herunter und startet keine Dienste.
148
+ - **Lokal oder entfernt:** Der Kern verlangt weder Cloud noch API-Schlüssel. Lokale Modelle können lokale Endpunkte nutzen; Anbieter und Werkzeuge bestimmen die Netzwerknutzung.
149
+
150
+ ## 📂 Beispiele und Dokumentation
151
+
152
+ - [Begleiter-Charakter](examples/companion_chat.py): ein Terminal-Chat mit einem Charakter, der sich merkt, was du erzählst, und sich mit der Zeit verändert, an einem lokalen OpenAI-kompatiblen Endpunkt.
153
+ - [Interaktiver Chat](examples/basic_chat.py) / [Werkzeuge](examples/tool_chat.py): Modell und Zugangsdaten in `.env` konfigurieren.
154
+ - [Sitzungen](examples/session_runtime.py): Speichern und Wiederherstellen mit temporärem Speicher und Offline-Client.
155
+ - [HTTP/SSE/WebSocket](examples/character_service.py): Servicebeispiel für Web und Mobilgeräte, standardmäßig mit Offline-Client. Für den Einsatz Inferenz und Authentifizierung konfigurieren.
156
+ - [Autonomy](examples/autonomy_host.py): Auslöser und Lebenszyklus integrieren.
157
+ - [Erinnerungskorrektur](tests/scenarios/memory_revision.py), [Reflexion und Überzeugungen](tests/scenarios/reflection_long_term_cognition.py), [Ziele](tests/scenarios/goal_motivation_runtime.py), [Wahrnehmung](tests/scenarios/world_environment.py): ausführbare Regressionsszenarien mit Konfiguration und erwarteten Ergebnissen.
158
+
159
+ [API-Referenz](docs/api-reference.md) · [Konfiguration](docs/configuration.md) · [Bereitstellung und Betrieb](docs/operations.md) · [Erweiterungen](docs/extensions.md)
160
+
161
+ ## Entwicklung und Lizenz
162
+
163
+ Aktuelle Version: **1.0.0**. CI prüft Linux/macOS/Windows × Python 3.11/3.12/3.13 sowie API-Kompatibilität, Persistenz-Replay, Fehlerinjektion, Leistung in gleicher Umgebung und Paketinstallation. [CI](https://github.com/weryk153/ai-character-engine/actions/workflows/ci.yml) · [Validierung](VALIDATION.md) · [Kompatibilität](docs/compatibility.md).
164
+
165
+ Fehlerberichte und Korrekturen sind willkommen; siehe [CONTRIBUTING](CONTRIBUTING.md). Lizenz: [Apache-2.0](LICENSE). Modelle, Stimmen und Assets Dritter behalten ihre eigenen Lizenzen.