Skip to main content

XO — Minimal Conversational Intelligence Framework with Memory and Reinforcement

Project description

XO

XO AI 🤖

XO — Minimal Conversational Intelligence Framework with Memory & Reinforcement Learning

XO is a lightweight, modular conversational AI framework designed for developers who want to build intelligent, context-aware, and self-improving chat systems. It combines short-term caching, long-term memory, and reinforcement-style learning to create natural, adaptive responses.


🚀 Features

  • Reinforcement Learning — XO learns from repeated user interactions.
  • Short-Term Cache System — Prioritizes frequently used topics dynamically.
  • Long-Term Memory — Persists knowledge across sessions.
  • CLI & SDK Modes — Use XO from code or command line.
  • Modular & Editable — Every logic layer (cache, memory, response) can be customized.
  • Lightweight & Fast — Zero external heavy dependencies.

🔧 Installation

From PyPI

pip install xo-ai

From Source

git clone https://github.com/xo-aria/xo-ai.git
cd xo-ai
pip install .

💻 Usage

🔹 As a Python Library (SDK)

from xo import AI

bot = AI("data.json")
response = bot.ask("hi")
print(response)

🔹 As Command Line Tool

XO provides a built-in CLI for easy interaction:

from xo.cli import run_cli

if __name__ == "__main__":
    run_cli()

And use cli in cmd:

xo run     # Start an interactive chat
xo train   # Merge long-term memory into database
xo reset   # Clear short-term cache
xo help    # Show command help

🧠 How XO Learns

  • Each repeated phrase increases its weight in memory (reinforcement).
  • Topics decay over time if unused.
  • When repetition threshold is reached, new learned patterns are merged into data.json automatically.

🖊️ Example Data File

{
  "conversation": {
    "hi": "hello there!",
    "how are you": "Howdy! What can I do for you?"
  },
  "shop": {
    "price": "The price varies by product. Which item interests you?"
  }
}

👩‍💻 For Developers

XO was built to be easily modifiable:

  • cache_system.py → short-term memory logic.
  • memory_system.py → reinforcement & decay logic.
  • response_engine.py → natural response selection.
  • cli.py → command-line interface.

You can modify these independently without breaking the framework.


🎨 Example CLI Output

$ xo run
XO is ready! Type 'exit' to quit.

You: hi
AI: hello there!

You: how are you
AI: Howdy! What can I do for you?

🔗 Links


💎 Credits

Created with ❤️ by XO Aria Designed for developers who believe AI should be both smart and simple.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

xo_ai-1.0.0.tar.gz (8.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

xo_ai-1.0.0-py3-none-any.whl (8.9 kB view details)

Uploaded Python 3

File details

Details for the file xo_ai-1.0.0.tar.gz.

File metadata

  • Download URL: xo_ai-1.0.0.tar.gz
  • Upload date:
  • Size: 8.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for xo_ai-1.0.0.tar.gz
Algorithm Hash digest
SHA256 29052480235acc248902f94cc9fb28b9939c026006b7f4e6e316ba1eaf391571
MD5 e87ee38b3e3a5ef65494bcf28a102517
BLAKE2b-256 e9c4c768341c7983cceb50033abe6ef6a430835ec2cd310dc35097007d50b1fb

See more details on using hashes here.

File details

Details for the file xo_ai-1.0.0-py3-none-any.whl.

File metadata

  • Download URL: xo_ai-1.0.0-py3-none-any.whl
  • Upload date:
  • Size: 8.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for xo_ai-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 12c7ac428ddb30aa8191d05b21f57c35eec7b90088ec4e1289e07c514f0af573
MD5 3807b196126a997384009b5251238a0d
BLAKE2b-256 b96f9b87165dd7bef4d1b468e435d682ed7e03ed64b8c77ba0b7089f41c521ef

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page