Ilm (イルム) is Arabic for "knowledge," but in this project, it symbolizes an AI that pursues "ephemeral inspiration."
Many modern AIs maintain conversational continuity by retaining context. The trade-off is that their thinking can become "trapped" by past dialogue, hindering free and creative ideation. When asked for new ideas, an AI often returns similar responses influenced by the preceding conversation.
Ilm is designed to solve this challenge. Its memory structure is based on an analogy of human memory.
L0: Working Memory (Consciousness)
: The cognitive space for generating responses is completely refreshed with every turn. No specific conversational text is carried over, allowing the AI to focus solely on the input of the "here and now." This enables fresh responses, untethered by past thoughts.
L1: Episodic Memory (Echo)
: It retains only the keywords from the last few conversational turns. When the user mentions one of these keywords again, the AI shows a semblance of recalling a fragment of memory, like déjà vu, adding a human-like depth to the conversation.
L2: Semantic Memory (Deep Experience)
: It does not store specific conversation content. Instead, it perpetually learns abstract patterns, suchs as "from which topic to which topic do transitions occur?" Based on this experience, the AI judges whether a topic shift is a "natural flow" or a "novel leap" and adjusts its response nuance accordingly.
Through this hierarchical memory system, Ilm aims for a human-like intelligence that combines ephemeral, refreshed thinking with accurate judgments based on long-term, abstracted experience.
Implemented Features
Dynamic Prompt Generation
: Constructs instructions (prompts) for the AI in real-time based on user input and the conversational context.
Intent & Style Detection
: Analyzes whether user input is a "Question" or a "Request for Ideas," and whether the writing style is "Polite" or "Concise," to optimize the AI's response tone.
Topic Transition Detection & Judgment
: Detects shifts in conversational topics and, based on L2 long-term memory, judges whether the transition is "natural" or "novel."
Flashback (Echoing Memory)
: If the user reuses a keyword the AI recently mentioned, it generates a response that seems to recall the previous context.
Long-Term Experience Accumulation
: Persistently records topic transition patterns in a SQLite database (
experience.db
), accumulating them as the AI's "experience."
Architecture
This application implements a "Hierarchical Memory System" composed of the following components:
Conductor
: The main logic within
app_structured.py
. It acts as the central module that receives user input, queries the memory layers, and constructs the final prompt for the LLM.
L0 (Working Memory)
: The ephemeral, single-use prompt passed to the LLM.
L1 (Episodic Memory)
: A short-term keyword buffer implemented with
deque
.
L2 (Semantic Memory)
: A persistent database implemented with
SQLite
that records topic transition patterns.
Setup and Usage
Clone the Repository
:
git clone <your-repo-url>
cd ilm-finetune
Create a Virtual Environment
:
python3 -m venv venv
source venv/bin/activate
Install Dependencies
:
pip install -r requirements.txt
Prepare the Fine-Tuned Model
:
This project assumes that a fine-tuned model exists in the
./merged_model
directory. The fine-tuning was performed using
mlx_lm
.
(Note: The specific steps for fine-tuning are outside the scope of this project, but the commands used during development are shown below for reference.)
gemma3-27b-mindspark huggingface.co is an AI model on huggingface.co that provides gemma3-27b-mindspark's model effect (), which can be used instantly with this kofdai gemma3-27b-mindspark model. huggingface.co supports a free trial of the gemma3-27b-mindspark model, and also provides paid use of the gemma3-27b-mindspark. Support call gemma3-27b-mindspark model through api, including Node.js, Python, http.
gemma3-27b-mindspark huggingface.co is an online trial and call api platform, which integrates gemma3-27b-mindspark's modeling effects, including api services, and provides a free online trial of gemma3-27b-mindspark, you can try gemma3-27b-mindspark online for free by clicking the link below.
kofdai gemma3-27b-mindspark online free url in huggingface.co:
gemma3-27b-mindspark is an open source model from GitHub that offers a free installation service, and any user can find gemma3-27b-mindspark on GitHub to install. At the same time, huggingface.co provides the effect of gemma3-27b-mindspark install, users can directly use gemma3-27b-mindspark installed effect in huggingface.co for debugging and trial. It also supports api for free installation.
gemma3-27b-mindspark install url in huggingface.co: