The v0.0.2 release of Knowledge-and-Memory-Management is a clean release that eliminates environment-specific configuration and extends knowledge ingestion capabilities. All hardcoded personal paths have been replaced with the $AGENT_HOME environment variable, making agent deployments reproducible across local development, staging, and production. Knowledge collection now supports web scraping, video transcript extraction, and article parsing, feeding a redesigned memory management system that handles deduplication, tagging, and concurrent access.
The shift to $AGENT_HOME directly addresses a common friction point in agent ops. Previously, path references tied agents to specific directory structures, causing failures when moving to containerized or shared environments. With v0.0.2, $AGENT_HOME acts as a single configurable base that all internal operations respect. If unset, the library defaults to ./agent_data, maintaining compatibility with local runs. This change is transparent but critical: it enables version control of agent configurations without path drift and simplifies CI/CD integration.
Knowledge collection in this release covers three primary sources, each handled by a dedicated extractor that outputs a normalized KnowledgeObject:
- Web: An HTML parser that extracts main content while discarding navigation, ads, and scripts. Metadata such as title, author, and publication date are preserved and attached to the object.
- Video: Integrates with platform APIs to fetch transcripts, comments, and metadata. Supports both live streams and archived videos.
- Article: Handles news feeds, blog posts, and RSS/Atom feeds. The extractor identifies the content body and strips boilerplate.
All extractors return objects with a consistent schema: content (plain text), metadata (dict), source_type (web/video/article), and timestamp. This uniformity is essential for downstream memory processing.
Memory management in v0.0.2 is backed by an embedded database optimized for semantic storage. Key features include:
- Deduplication: Content is hashed on ingestion. Duplicate hashes are silently ignored, preventing storage bloat from repeated scrapes.
-
Tag-based indexing: Each
KnowledgeObjectcan be stored with one or more tags (e.g.,['tutorial', 'python']). Tags support efficient filtering without full-text search. - Concurrent write support: The store uses per-collection mutexes, allowing multiple collection threads to write simultaneously without corruption.
- Relevance scoring: Frequently accessed memories get a boost in query results. This is useful for agents that prioritize commonly used knowledge.
Code Example
The following example demonstrates a typical workflow with the v0.0.2 API:
import os
from kmm import AgentKnowledge
# Initialize using $AGENT_HOME or fallback
ak = AgentKnowledge(home=os.getenv('AGENT_HOME', './agent_data'))
# Collect and store knowledge from multiple sources
ak.collect.web('https://docs.example.com/getting-started')
ak.collect.video('https://youtube.com/watch?v=abc123')
ak.collect.article('https://news.example.com/latest-tech')
# Query memories with tag filtering
results = ak.memory.query('setup guide', tags=['web', 'tutorial'])
for r in results:
print(f"[{r.timestamp}] {r.content[:200]}...")
The AgentKnowledge class encapsulates both collection and memory. The home parameter reads $AGENT_HOME at initialization, and all subsequent paths are derived from it. No absolute paths appear in the codebase. The collect methods handle network requests, parsing, and normalization automatically. The memory.query method combines full-text search with tag intersection, returning a list of relevant KnowledgeObject instances.
Implications for Agent Development
For experienced developers, this release reduces boilerplate in several ways:
Path portability removes environment-specific configuration files. Teams can share agent setups without adjusting paths. $AGENT_HOME can be set in a Docker environment variable, .env file, or orchestration config, and the agent will adjust accordingly.
Multi-source collection eliminates the need for custom scrapers. Instead of maintaining separate parsers for web pages, YouTube, and news feeds, developers rely on the built-in extractors. The normalized output format ensures that memory management treats all ingested knowledge uniformly.
Memory deduplication prevents storage waste when agents repeatedly scrape the same sources. Tagging replaces complex folder structures with a flat indexing system, simplifying retrieval logic.
Concurrent write support is critical for production agents that collect knowledge in the background while serving queries. The thread-safe store avoids locking issues without external middleware.
Conclusion
Knowledge-and-Memory-Management v0.0.2 is a focused release that addresses two major pain points in agent knowledge pipelines: environment-dependent paths and heterogeneous data ingestion. The switch to $AGENT_HOME makes agents
Top comments (0)