# Knowledge-and-Memory-Management v0.0.2: Portable Memory for AI Agents

> Source: <https://dev.to/mage0535/knowledge-and-memory-management-v002-portable-memory-for-ai-agents-3l45>
> Published: 2026-07-08 06:01:20+00:00

The latest release of Knowledge-and-Memory-Management (KMM) v0.0.2 delivers a clean, production-ready iteration of its knowledge collection and memory management subsystems. This version strips away all hardcoded, environment-specific paths and replaces them with the `$AGENT_HOME`

variable, offering true portability across deployment targets. For developers building long-running agents or personal knowledge tools, this release tightens the feedback loop between ingestion, storage, and retrieval without sacrificing clarity or control.

The core thrust of this release is twofold: making knowledge ingestion from disparate sources straightforward and ensuring that stored data is easy to locate and organize. The collection module now supports three primary sources—web pages, video transcripts (e.g., from YouTube or local media), and structured articles (Atom/RSS feeds or Markdown files). Each source is handled by a dedicated extractor that normalizes content into a common document schema, which then flows into a memory backend. The big change in v0.0.2 is that the memory backend no longer assumes a fixed filesystem layout. Instead, it relies on the `$AGENT_HOME`

environment variable to resolve the root storage directory. This eliminates the friction of moving agent data between machines, containers, or CI environments.

Here is a short example that demonstrates setting up a collector and storing knowledge from a web page and an article feed:

``` python
from kmm import Collector, MemoryStore

# The memory store uses $AGENT_HOME/data as its base directory
memory = MemoryStore(base_path="$AGENT_HOME/data")

collector = Collector(
    sources=["web", "article"],
    storage=memory
)

# Ingest a speculative blog post
collector.ingest(
    source="web",
    uri="https://example.com/large-language-models"
)

# Pull in the latest articles from an RSS feed
collector.ingest(
    source="article",
    uri="https://blog.example.com/feed.xml"
)

# The memory store persists everything under $AGENT_HOME/data
# with a directory structure organized by source type and date.
```

In the code, `MemoryStore`

resolves `$AGENT_HOME`

at initialization, so moving the agent to a new machine only requires that variable to be set appropriately. The collector accepts a source type—`"web"`

, `"video"`

, or `"article"`

—and a URI. For video sources, KMM extracts transcripts using subtitle files or speech-to-text outputs, while web and article sources parse HTML or XML into clean text. The normalisation step strips formatting and metadata, keeping only the body content and a few salient fields like title, date, and source URL.

Under the hood, the memory manager indexes each ingested document by its content hash and timestamps, ensuring idempotency if the same URL is collected twice. The storage layout is straightforward: `$AGENT_HOME/data/web/YYYY-MM-DD/`

, `$AGENT_HOME/data/video/`

, and similarly for articles. This makes it trivial to inspect collected knowledge with standard filesystem tools or to build custom indexing pipelines on top.

One subtle but important improvement in v0.0.2 is the handling of relative paths inside the collector configuration. Previously, auxiliary files such as user‑agent rules or scraping patterns had to be referenced with absolute paths. This release moves all such dependencies under `$AGENT_HOME`

, so a configuration file like `agent.yml`

can simply refer to `$AGENT_HOME/config/scraping_rules.json`

without knowing the absolute location. This change alone reduces setup time for teams deploying agents across staging, testing, and production environments.

For experienced developers, the most immediate value lies in the separation of concerns: the collector only cares about extraction, the memory manager only about persistence, and `$AGENT_HOME`

bridges the two without coupling them to the filesystem. You can swap the backend to a database or cloud storage by implementing a thin adapter against the same interface. The current release focuses on local file storage for simplicity, but the architecture is ready for extension.

This release also deprecates the old `--data-dir`

and `--cache-dir`

command‑line flags. Any setup that relied on those will need to migrate to the environment variable. The migration path is simple: declare `AGENT_HOME`

and move your agent’s data folder to that location. The library will emit a warning if `$AGENT_HOME`

is unset, pointing to the documentation.

KMM v0.0.2 is not a flashy release. It is a boring, necessary cleanup that makes knowledge management infrastructure predicatable. For developers who have been stitching together scrapers, transcript downloaders, and ad‑hoc storage scripts, this release provides a unified workflow that respects the portability demands of modern agent development. The next planned feature set (semantic search over collected articles and videos) will build directly on this foundation.
