Skip to main content

Language-agnostic associative memory runtime for persistent AI systems

Project description

Intentmind 🧠

PyPI version Python License

Intentmind is a next-generation associative memory runtime designed for autonomous AI agents, copilots, and long-term conversation systems.

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 of interactions.


🛑 The Problem with Classic RAG

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

  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 align in the vector space.
  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 living, breathing Cognitive Graph.

1. Associative Recall (Graph-RAG)

When data is ingested, Intentmind extracts core "intents" (nodes) and connects them (edges). When a user mentions a concept, the system doesn't just do a vector search—it traverses the graph. Mentioning "insurance" lights up the "car" node, pulling in the exact historical context your agent needs to sound truly intelligent.

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". This prevents context bloat and ensures your agent only remembers what actually matters.

3. Emotional Weighting

Intentmind features a built-in Emotion Engine. It scores the user's current query for stress, urgency, or sentiment, and adjusts the memory retrieval weights dynamically. A panicked user gets immediate, high-confidence facts, while a casual user gets broader, associative exploration.


🎯 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 (Check out our built-in Corporate Negotiation Simulator).

🚀 Quick Start

Installation

# Core package
pip install intentmind

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

1-Minute Integration

Intentmind is designed to be completely language-agnostic and drop-in ready.

from intentmind import IntentmindMemory
from intentmind.embeddings import SentenceTransformerEmbedder

# 1. Initialize the Cognitive Engine
mem = IntentmindMemory(embedder=SentenceTransformerEmbedder())

# 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 literally see what your AI is thinking and how it connects concepts.

mem.visualize("memory_map.html")

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


🧪 Try the Advanced Examples

The /examples directory contains powerful demonstrations of Intentmind's capabilities:

  • life_simulator.py: Simulates years of a person's life. Watch the agent form long-term memories and organically "forget" mundane details via memory decay.
  • corporate_negotiation_simulator.py: Two AI agents with separate Intentmind brains negotiating a merger, reading each other's intents and pulling historical precedents from their memory graphs.
  • autonomous_agent.py: A self-directed agent that uses Intentmind to maintain its internal state and goals over long execution loops.

🌐 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 a Custom Non-Commercial 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.

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

We welcome contributions for new embedders, LLM adapters (Claude, Llama3), 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.1.4.tar.gz (46.2 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.1.4-py3-none-any.whl (49.8 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for intentmind-0.1.4.tar.gz
Algorithm Hash digest
SHA256 5924d323d76d921f8548f7a0fa8bd306d172fcfb891113b4b75927c6de347ded
MD5 ae047fd9b3aa15e415ad93060cdf9357
BLAKE2b-256 31f207d3fc878d27fefed10591aa73748b16e4729845262842d2cb3060b102e8

See more details on using hashes here.

Provenance

The following attestation bundles were made for intentmind-0.1.4.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.1.4-py3-none-any.whl.

File metadata

  • Download URL: intentmind-0.1.4-py3-none-any.whl
  • Upload date:
  • Size: 49.8 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.1.4-py3-none-any.whl
Algorithm Hash digest
SHA256 1507f039e818de1a37fa6f218e16ef08b3c228514301a4e412037dcfe8ebe8bb
MD5 17f5a312a143de129ed0bb9df2fb6171
BLAKE2b-256 05f54aaf4b43f3b6e66e2ac149942b10b1ae2674630a3a0d1df3f49f735cc344

See more details on using hashes here.

Provenance

The following attestation bundles were made for intentmind-0.1.4-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