Skip to main content

Language-agnostic associative memory runtime for persistent AI systems

Project description

Intentmind 🧠

PyPI version Python License

Intentmind is a Cognitive Operating Layer for Persistent AI. It acts as the foundational "Memory OS" for autonomous AI agents, copilots, simulators, and AI NPCs.

It moves beyond standard RAG by mimicking human cognitive processes—building a dynamic Knowledge Graph, forming associative connections, and employing biological "forgetting" mechanisms to maintain a pristine, highly relevant context window over months or years of interactions.


🛑 The Problem with Classic RAG

If you are building an autonomous system or an AI agent that lives for more than a single session, you will quickly hit the limits of standard Vector Database RAG wrappers:

  1. Amnesia by Proxy: Standard RAG relies on overlapping embeddings. If a user talks about buying a "car" on Monday, and asks for help with "insurance" on Friday, standard RAG will fail to connect them unless the exact keywords or vector spaces strictly align.
  2. Context Bloat: Vector DBs append data forever. Over time, your agent gets overwhelmed by thousands of trivial, outdated, or conflicting memories, destroying the LLM's accuracy.
  3. Flat Representation: Standard RAG treats all data equally. It lacks the ability to understand that some memories are core to the user's identity, while others were just passing thoughts.

🌟 The Solution: Why Intentmind?

Intentmind doesn't just store documents; it builds a dynamic associative memory graph with energy-based activation, decay, reinforcement, and traceable recall paths.

1. Associative Recall (Semantic Drift Recovery)

When data is ingested, Intentmind extracts core concepts (nodes) and connects them (edges). When a user mentions a concept, the system doesn't just do a vector search—it traverses the graph.

Example of Semantic Drift: User talks about their car ➔ then plans a trip ➔ then asks about insurance. Intentmind naturally traverses the graph from car to insurance, pulling in the exact historical context your agent needs to sound truly intelligent, even if the raw embeddings don't directly match.

2. Biological Forgetting (Energy & Decay)

Intentmind introduces an Energy system. Every time a memory is recalled, its connection strengthens (like human synapses). Unused, irrelevant, or noisy memories slowly decay and are eventually "forgotten" (archived). This prevents context bloat and ensures your agent only remembers what actually matters.

3. Cognitive State Modulation

Previously known as the "Emotion Engine", this system features an Adaptive Urgency Matrix. It dynamically scores the user's current query for stress, urgency, or sentiment, and applies retrieval priority modulation. A highly urgent query immediately surfaces hard, high-confidence facts, while a casual conversational query triggers broader, associative exploration.


⚔️ Why not just GraphRAG?

GraphRAG is fantastic for static document analysis, but it fails for persistent, living agents.

Feature Vanilla RAG GraphRAG Intentmind
Primary Use Case Q&A on Docs Knowledge Discovery Living AI Agents
Memory Architecture Static Vectors Static Graph Dynamic Fluid Graph
Associative Activation No Hardcoded Edges Energy Propagation
Memory Aging No (Bloats forever) No Biological Forgetting (Decay)
Reinforcement No No Synaptic Strengthening via Reuse

📊 Performance Benchmarks

Synthetic Semantic Drift Benchmark

  • Dataset: 1,000 memory facts
  • Noise: 30%
  • Query type: delayed indirect recall
System Accuracy
Vanilla vector search 42%
Intentmind 68%

Note: These are local regression benchmarks, not independent research claims. Intentmind is built to be resilient to long-session degradation where other systems degrade.


🎯 Who is this for?

  • Autonomous Agents & AI Personas: Give your AI agents long-term, evolving memory. As they interact with the world, their internal cognitive graph adapts, making them highly personalized and context-aware.
  • Persistent Copilots: Build customer support bots, coding assistants, or personal companions that remember user preferences seamlessly over years of interaction without polluting the LLM context window.
  • Complex Simulators: Drive simulations where multiple entities negotiate, learn, and forget based on cognitive connections.

🚀 Quick Start

Installation

# Core package
pip install intentmind

# With recommended production dependencies (FAISS, SentenceTransformers, OpenAI)
pip install "intentmind[all]"

1-Minute Integration

While the core graph logic is language-agnostic, extraction quality is embedding-model dependent. We recommend using multilingual models for non-English data.

from intentmind import IntentmindMemory
from intentmind.embeddings import SentenceTransformerEmbedder

# Option A: Local deterministic demo (fastest, no LLM needed)
mem = IntentmindMemory(is_test=True, core_extractor="deterministic")

# Option B: Production embeddings with deterministic extraction
# mem = IntentmindMemory(embedder=SentenceTransformerEmbedder(), core_extractor="deterministic")

# Option C: Production with full LLM-assisted extraction (requires OPENAI_API_KEY)
# mem = IntentmindMemory(embedder=SentenceTransformerEmbedder(), core_extractor="llm")

# 2. Teach it concepts (Happens naturally during conversation)
mem.add("I need car insurance but I have no money.")
mem.add("I bought a new car and will drive to London.")

# 3. Ask a tangential question
result = mem.query("I have a car and I am going to London.")

# 4. Watch it traverse the graph and retrieve the exact context
for item in result["memories"]["items"]:
    print(f"[{item['layer']}] Path: {item.get('path', [])} -> {item['text']}")

🔌 Seamless Integrations

LangChain Adapter

Drop Intentmind straight into your existing LangChain pipelines as a custom, ultra-smart Retriever.

from intentmind.integrations.langchain import IntentmindRetriever

retriever = IntentmindRetriever(memory=mem)
docs = retriever.invoke("How does the energy model work?")

Persistence (Save & Load)

Save the entire brain (vectors, nodes, edges, decay states) to disk instantly.

mem.save("my_agent_brain.json")
mem = IntentmindMemory.load("my_agent_brain.json")

📊 Visualizing the "Brain"

Intentmind isn't a black box. You can export the entire Cognitive Graph to an interactive HTML map to visualize the graph structure, energy levels, and synaptic connections.

mem.visualize("memory_map.html")

(Open memory_map.html in your browser to explore clustering, energy levels, and synaptic connections)


🌐 Demo API & React UI

Intentmind includes a built-in FastAPI backend and a beautiful React/Vite UI to test your graphs visually.

  1. Start Backend:
    pip install "intentmind[api]"
    # Make sure OPENAI_API_KEY is in your .env
    python api.py
    
  2. Start Frontend UI:
    cd ui
    npm install
    npm run dev
    

🤝 Contributing & License

Intentmind is released under the Intentmind Fair-Code License.

  • Personal & Academic Use: Completely free! You can use, modify, and experiment with Intentmind for your personal projects, academic research, or hobby apps.
  • Commercial Use: If you plan to use Intentmind in a commercial product, SaaS, or any revenue-generating service, you must obtain prior written consent or a commercial license.

For commercial licensing inquiries, please reach out via GitHub issues or contact the author directly.

We welcome contributions for new embedders, LLM adapters, and vector store integrations! Build the future of AI memory with us.

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

intentmind-0.2.1.tar.gz (46.9 kB view details)

Uploaded Source

Built Distribution

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

intentmind-0.2.1-py3-none-any.whl (50.1 kB view details)

Uploaded Python 3

File details

Details for the file intentmind-0.2.1.tar.gz.

File metadata

  • Download URL: intentmind-0.2.1.tar.gz
  • Upload date:
  • Size: 46.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for intentmind-0.2.1.tar.gz
Algorithm Hash digest
SHA256 913146902186a5d1e5f027808e741bd5f2a811a9f3d01df88a7c3dda59d875ff
MD5 338076ad18f8204d33a8c7a9049d304d
BLAKE2b-256 b7a36c753da3bb908c64715043ca41712e11b03061d7d72575526c6830900251

See more details on using hashes here.

Provenance

The following attestation bundles were made for intentmind-0.2.1.tar.gz:

Publisher: publish.yml on avnialkan/intentmind

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file intentmind-0.2.1-py3-none-any.whl.

File metadata

  • Download URL: intentmind-0.2.1-py3-none-any.whl
  • Upload date:
  • Size: 50.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for intentmind-0.2.1-py3-none-any.whl
Algorithm Hash digest
SHA256 dda0d74fe2ef46102493b0b0946873c699304cff645aabcd81a481f40d4c55b1
MD5 cc605ee2ac0eeaad42e9f47c3c0e16e0
BLAKE2b-256 836ae1958e51c3891b7678a2dde5ef7a6e4b1a6eefdad0dcb92f131b6837b3a8

See more details on using hashes here.

Provenance

The following attestation bundles were made for intentmind-0.2.1-py3-none-any.whl:

Publisher: publish.yml on avnialkan/intentmind

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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