New to Claude Skills? Learn how to install them →

thedotmack on GitHub

Knowledge Agent

Free

Build and query AI-powered knowledge bases from observations.

Get this skill

Free · Opens the source repo

What Knowledge Agent does

The Knowledge Agent skill allows users to create and manage AI-powered knowledge bases derived from their observation history within the claude-mem framework. This tool is particularly useful for developers and designers who need to consolidate information about specific topics, decisions, or patterns from past work. By building a corpus of observations, users can generate a focused AI session that serves as a custom knowledge repository, enabling them to ask context-aware questions and receive informed answers.

To use the Knowledge Agent, you begin by building a corpus, which involves specifying parameters such as project name, types of observations, and relevant concepts. This process allows you to filter and compile a targeted set of data that is relevant to your needs. Once the corpus is built, you can prime it to create an AI session that retains the context of the information, making it easier to query later. This feature is particularly beneficial for teams working on complex projects where tracking decisions and changes is crucial.

The querying process is straightforward; users can ask specific questions about the corpus, and the AI will respond based on the compiled knowledge. The ability to maintain context across follow-up questions enhances the interaction, making it feel more conversational and intuitive. Additionally, the Knowledge Agent supports maintenance features such as rebuilding and repriming corpora, ensuring that your knowledge base stays current with the latest observations.

Overall, the Knowledge Agent skill is designed for those who require a structured way to leverage past observations and decisions, facilitating better-informed discussions and insights in their projects.

When to use it

Use the Knowledge Agent when you need to create a focused knowledge base from your past observations for quick and contextual querying.

When not to use it

This skill may not be suitable for users looking for general knowledge retrieval or those who do not have a structured observation history.

What you can build with it

Creating a focused knowledge base

Build a corpus for a specific topic, like 'hooks-expertise', to have a dedicated resource for related queries.

Tracking decision-making patterns

Compile observations on past decisions to analyze trends and improve future project strategies.

Answering technical questions

Use the AI session to ask detailed questions about your project, receiving answers based on your compiled knowledge.

How to install Knowledge Agent

View source

1. Install with the skills CLI

npx skills add thedotmack/claude-mem/knowledge-agent --agent claude-code

2. Or install it manually

Download the skill folder and drop it into ~/.claude/skills/ for all projects, or .claude/skills/ to scope it to one repo. Restart Claude Code so it picks up the new skill.

Anthropic's agentic coding CLI, and the reference implementation of Agent Skills. Drop a skill folder into ~/.claude/skills and Claude Code loads it automatically whenever a task matches the skill's description. Claude Code docs

Inside SKILL.md

Written by thedotmack

Knowledge Agent

Build and query AI-powered knowledge bases from claude-mem observations.

What Are Knowledge Agents?

Knowledge agents are filtered corpora of observations compiled into a conversational AI session. Build a corpus from your observation history, prime it (loads the knowledge into an AI session), then ask it questions conversationally.

Think of them as custom "brains": "everything about hooks", "all decisions from the last month", "all bugfixes for the worker service".

Workflow

Step 1: Build a corpus

build_corpus name="hooks-expertise" description="Everything about the hooks lifecycle" project="claude-mem" concepts="hooks" limit=500

Filter options:

  • project — filter by project name
  • types — comma-separated: decision, bugfix, feature, refactor, discovery, change
  • concepts — comma-separated concept tags
  • files — comma-separated file paths (prefix match)
  • query — semantic search query
  • dateStart / dateEnd — ISO date range
  • limit — max observations (default 500)

Step 2: Prime the corpus

prime_corpus name="hooks-expertise"

This creates an AI session loaded with all the corpus knowledge. Takes a moment for large corpora.

Step 3: Query

query_corpus name="hooks-expertise" question="What are the 5 lifecycle hooks and when does each fire?"

The knowledge agent answers from its corpus. Follow-up questions maintain context.

Step 4: List corpora

list_corpora

Shows all corpora with stats and priming status.

Tips

  • Focused corpora work best — "hooks architecture" beats "everything ever"
  • Prime once, query many times — the session persists across queries
  • Reprime for fresh context — if the conversation drifts, reprime to reset
  • Rebuild to update — when new observations are added, rebuild then reprime

Maintenance

Rebuild a corpus (refresh with new observations)

rebuild_corpus name="hooks-expertise"

After rebuilding, reprime to load the updated knowledge:

Reprime (fresh session)

reprime_corpus name="hooks-expertise"

Clears prior Q&A context and reloads the corpus into a new session.

Frequently asked questions about Knowledge Agent

Similar skills