Skip to main content

Neurotransmitter-inspired adaptive learning layer for LLMs

Project description

Limbiq

Neurotransmitter-inspired adaptive learning layer for LLMs.

Limbiq makes any LLM appear to learn and adapt across conversations — without touching a single weight. It sits between the user and the LLM, modifying what the model sees through five discrete signal types inspired by human brain chemistry.

User → Limbiq → Modified Context → Any LLM → Response → Limbiq observes → Loop

Installation

pip install limbiq

Quick Start

from limbiq import Limbiq

# Initialize
lq = Limbiq(
    store_path="./neuro_data",
    user_id="dimuthu",
)

# Before sending to LLM — get enriched context
result = lq.process(
    message="What's my wife's name?",
    conversation_history=[
        {"role": "user", "content": "Hi there"},
        {"role": "assistant", "content": "Hello! How can I help?"},
    ],
)

# Inject result.context into your system prompt
messages = [
    {"role": "system", "content": f"You are a helpful assistant.\n\n{result.context}"},
    {"role": "user", "content": "What's my wife's name?"},
]
response = my_llm(messages)  # Any LLM

# After getting response — let Limbiq observe and learn
lq.observe("What's my wife's name?", response)

# End session — triggers memory compression
lq.end_session()

Signals (v0.1)

Dopamine — "This matters, remember it"

Fires when the user shares personal info, corrects the model, or gives positive feedback. Tagged memories are always included in context.

lq.dopamine("User's wife is named Prabhashi")

GABA — "Suppress this, let it fade"

Fires when memories are denied, contradicted, or go stale. Suppression is soft — memories can be restored.

lq.gaba(memory_id="abc123")
lq.restore_memory("abc123")  # Undo suppression

Corrections

Combines both signals — stores new info as priority, suppresses the old.

lq.correct("User works at Bitsmedia, not Google")

Inspection

lq.get_stats()              # Memory counts per tier
lq.get_signal_log()         # Full history of signals fired
lq.get_priority_memories()  # All dopamine-tagged memories
lq.get_suppressed()         # All GABA-suppressed memories
lq.export_state()           # Full JSON export for debugging

How It Works

  • LLM-agnostic — works with any LLM (OpenAI, Anthropic, Ollama, llama.cpp, etc.)
  • Zero weight modification — all adaptation through context manipulation
  • SQLite persistence — memories survive across sessions
  • Semantic search — uses sentence-transformers for embedding-based retrieval (falls back to TF-IDF if not installed)
  • Transparent — every signal is logged with trigger, timestamp, and effect
  • Reversible — suppressed memories can be restored, nothing is permanently destructive

License

MIT

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

limbiq-0.2.0.tar.gz (31.7 kB view details)

Uploaded Source

Built Distribution

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

limbiq-0.2.0-py3-none-any.whl (31.6 kB view details)

Uploaded Python 3

File details

Details for the file limbiq-0.2.0.tar.gz.

File metadata

  • Download URL: limbiq-0.2.0.tar.gz
  • Upload date:
  • Size: 31.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.5

File hashes

Hashes for limbiq-0.2.0.tar.gz
Algorithm Hash digest
SHA256 21c09653f5f4a8fbf65c565b6d705b77925c485e719170eefa13469f8c15ff21
MD5 d45a7c77a130eecf32632a3961030b27
BLAKE2b-256 fe0016756f414b6fb25a13adc367fcd696ade89108341c4095edf2d1856f1de8

See more details on using hashes here.

File details

Details for the file limbiq-0.2.0-py3-none-any.whl.

File metadata

  • Download URL: limbiq-0.2.0-py3-none-any.whl
  • Upload date:
  • Size: 31.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.5

File hashes

Hashes for limbiq-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 5cd04fba2da4bd8333d631e28156ed038f6d7b6225bd13b1eecfc30260c64985
MD5 8085100a5520a13ca8db66af06b08fec
BLAKE2b-256 74b80dd4225cdeb1b16e7d4fc4824fab1f9f5163b263ff498aa2af1f76243742

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