Skip to main content

Give your AI long-term memory in 1 command. SQLite-based, no setup, no servers.

Project description

AI-IQ

Give your AI long-term memory in 1 command.

LLMs forget everything. AI-IQ makes them remember.

Install

pip install ai-iq

Quick Start

from ai_iq import Memory

memory = Memory()

# Add memories
memory.add("User prefers dark mode", tags=["preference", "ui"])
memory.add("Redis bug fixed with network_mode: host", category="learning")

# Search (hybrid keyword + semantic)
results = memory.search("redis networking")
for r in results:
    print(f"#{r['id']}: {r['content']}")

# Update and delete
memory.update(1, "User STRONGLY prefers dark mode")
memory.delete(1)

CLI

memory-tool add learning "Docker needs network_mode: host" --project MyApp
memory-tool search "docker networking"
memory-tool dream  # Consolidate duplicates, detect conflicts

Claude Code Plugin

Use AI-IQ directly in Claude Code with auto-capture:

/plugin marketplace add kobie3717/ai-iq
/plugin install ai-iq

See CLAUDE_CODE_PLUGIN.md for details.

Why AI-IQ?

  • Single SQLite file = your AI's brain — No servers, no vector DB, no setup
  • No cloud dependencies — Works offline, owns your data, zero API keys
  • Works with any Python agent — Not locked to Claude, OpenAI, or any vendor
  • Hybrid search — Keyword (FTS5) + semantic (vector) + graph traversal
  • Memories decay naturally — FSRS-6 algorithm like human memory

Advanced Features

See docs/REFERENCE.md for complete documentation:

  • Passport System — Complete identity card for any memory (graph connections, provenance chain, access patterns, confidence score)
  • Reflexion Self-Improvement — Learn from mistakes with structured reflections (20-40% task improvement)
  • Beliefs & Predictions — Confidence tracking with Bayesian updates
  • Knowledge Graph — Entities, relationships, spreading activation
  • Dream Mode — REM-like consolidation (dedup, conflict detection)
  • Identity Layer — Auto-discovers behavioral traits
  • Narrative Memory — Builds cause-effect stories from causal graph
  • Meta-Learning — Search improves from feedback loops

Passport System

Every memory has a "passport" — its complete identity card across all dimensions:

memory-tool passport 42

Shows:

  • Core identity: content, category, project, tags
  • Graph connections: linked entities with their relationships
  • Memory relationships: derived-from, related, supersedes chains
  • Provenance: citations, reasoning, source memories
  • Usage stats: access count, revisions, FSRS state
  • Passport score: composite 0-10 score from priority, access patterns, proof count, graph connections, and recency
  • Spreading activation: related entities discovered via graph traversal

Like a traveler's passport proves who you are and where you've been, a memory passport is its complete dossier.

Reflexion Self-Improvement

Learn from past mistakes with structured reflections (20-40% improvement on repeated tasks):

# Before starting a task
memory-tool reflect-load "nginx configuration"
# Shows: what failed before, what worked, what to do differently

# After completing a task
memory-tool reflect "Fixed nginx SSL config" \
  --outcome success \
  --worked "Tested syntax with nginx -t first" \
  --failed "None" \
  --next "Keep testing syntax before reload"

# Review patterns
memory-tool lessons
# Shows: task types with high failure rates needing attention

See docs/REFLEXION.md for complete guide.

Example

See examples/chatbot_with_memory.py

Documentation

Complete ReferenceExamplesArchitecture

Requirements

Python 3.8+ and SQLite 3.37+. Optional: pip install ai-iq[full] for semantic search.

License

MIT

Links

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

ai_iq-5.10.0.tar.gz (175.4 kB view details)

Uploaded Source

Built Distribution

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

ai_iq-5.10.0-py3-none-any.whl (138.7 kB view details)

Uploaded Python 3

File details

Details for the file ai_iq-5.10.0.tar.gz.

File metadata

  • Download URL: ai_iq-5.10.0.tar.gz
  • Upload date:
  • Size: 175.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.10.12

File hashes

Hashes for ai_iq-5.10.0.tar.gz
Algorithm Hash digest
SHA256 04fe257a6f2b171579adc0ef58452e1a76848b33fe2d6ce7ff7f3a02a3b4b286
MD5 754036b6888af69034ac270f80882488
BLAKE2b-256 77ee02a2538d5bca9a8db24f7a3701f0a3b1cace9abccacb649e16ad7e935870

See more details on using hashes here.

File details

Details for the file ai_iq-5.10.0-py3-none-any.whl.

File metadata

  • Download URL: ai_iq-5.10.0-py3-none-any.whl
  • Upload date:
  • Size: 138.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.10.12

File hashes

Hashes for ai_iq-5.10.0-py3-none-any.whl
Algorithm Hash digest
SHA256 f11ac279d6d8217ad0bb418f84da2ad65aae1edf270ed1fc4dd6c11b968ae381
MD5 63643f7bcdf532934a8dc50259c7e135
BLAKE2b-256 f341e05d2fad7f60a846c132a756577ac4434fc5f7697bd948085bc9fd1b357f

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