Cognee Session Memory and Improve
topoteretes/cognee
Explains how cognee stores session memory by session_id and bridges it into the permanent graph with improve(), including the stages, results and settings.
Persist agent state across runs, shape what the LLM sees per turn, and cap history to fit a context window.
$ npx skills add ag2ai/build-with-ag2 --skill ag2-knowledge-and-memory -a claude-codeProject install by default; add -g for ~/.claude/skills/.
$ gh skill install ag2ai/build-with-ag2 ag2-knowledge-and-memory --agent claude-codeProject scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).
$ git clone --depth 1 https://github.com/ag2ai/build-with-ag2.git skills-src && mkdir -p .claude/skills && cp -r skills-src/.agents/skills/ag2-knowledge-and-memory .claude/skills/ag2-knowledge-and-memory && rm -rf skills-srcUse ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.
Claude Code skills documentation · loads skills from .claude/skills/
Install the "ag2-knowledge-and-memory" agent skill from https://github.com/ag2ai/build-with-ag2/tree/main/.agents/skills/ag2-knowledge-and-memory into .claude/skills/ag2-knowledge-and-memory/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "ag2-knowledge-and-memory", then confirm the skill loads.Claude Code copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$skill-installer install https://github.com/ag2ai/build-with-ag2/tree/main/.agents/skills/ag2-knowledge-and-memoryType this inside Codex. $skill-installer <name> installs a curated skill from openai/skills. The installer writes to $CODEX_HOME/skills (default ~/.codex/skills). Restart Codex if the skill does not show up.
$ npx skills add ag2ai/build-with-ag2 --skill ag2-knowledge-and-memory -a codexProject install goes to .agents/skills/; add -g for ~/.codex/skills/.
$ gh skill install ag2ai/build-with-ag2 ag2-knowledge-and-memory --agent codexProject scope by default (.agents/skills/); add --scope user for a personal install.
$ git clone --depth 1 https://github.com/ag2ai/build-with-ag2.git skills-src && mkdir -p .agents/skills && cp -r skills-src/.agents/skills/ag2-knowledge-and-memory .agents/skills/ag2-knowledge-and-memory && rm -rf skills-srcUse ~/.agents/skills/ instead of .agents/skills for a personal install.
Codex skills documentation · loads skills from .agents/skills/
Install the "ag2-knowledge-and-memory" agent skill from https://github.com/ag2ai/build-with-ag2/tree/main/.agents/skills/ag2-knowledge-and-memory into .agents/skills/ag2-knowledge-and-memory/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "ag2-knowledge-and-memory", then confirm the skill loads.Codex copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$ npx skills add ag2ai/build-with-ag2 --skill ag2-knowledge-and-memory -a cursorProject install goes to .agents/skills/; add -g for ~/.cursor/skills/.
$ gh skill install ag2ai/build-with-ag2 ag2-knowledge-and-memory --agent cursorProject scope by default (.agents/skills/); add --scope user for a personal install.
$ git clone --depth 1 https://github.com/ag2ai/build-with-ag2.git skills-src && mkdir -p .cursor/skills && cp -r skills-src/.agents/skills/ag2-knowledge-and-memory .cursor/skills/ag2-knowledge-and-memory && rm -rf skills-srcUse ~/.cursor/skills/ instead of .cursor/skills for a personal install.
Cursor skills documentation · loads skills from .cursor/skills/, .agents/skills/, .claude/skills/, .codex/skills/
Install the "ag2-knowledge-and-memory" agent skill from https://github.com/ag2ai/build-with-ag2/tree/main/.agents/skills/ag2-knowledge-and-memory into .cursor/skills/ag2-knowledge-and-memory/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "ag2-knowledge-and-memory", then confirm the skill loads.Cursor copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$ gemini skills install https://github.com/ag2ai/build-with-ag2.git --path .agents/skills/ag2-knowledge-and-memory--scope user (default) or --scope workspace; --path is the subfolder of the repo that holds the skill; --consent skips the security confirmation prompt.
$ npx skills add ag2ai/build-with-ag2 --skill ag2-knowledge-and-memory -a gemini-cliProject install goes to .agents/skills/; add -g for ~/.gemini/skills/.
$ gh skill install ag2ai/build-with-ag2 ag2-knowledge-and-memory --agent gemini-cliProject scope by default (.agents/skills/); add --scope user for a personal install.
$ git clone --depth 1 https://github.com/ag2ai/build-with-ag2.git skills-src && mkdir -p .gemini/skills && cp -r skills-src/.agents/skills/ag2-knowledge-and-memory .gemini/skills/ag2-knowledge-and-memory && rm -rf skills-srcUse ~/.gemini/skills/ instead of .gemini/skills for a personal install, then run /skills reload.
Gemini CLI skills documentation · loads skills from .gemini/skills/, .agents/skills/
Install the "ag2-knowledge-and-memory" agent skill from https://github.com/ag2ai/build-with-ag2/tree/main/.agents/skills/ag2-knowledge-and-memory into .gemini/skills/ag2-knowledge-and-memory/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "ag2-knowledge-and-memory", then confirm the skill loads.Gemini CLI copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$ gh skill install ag2ai/build-with-ag2 ag2-knowledge-and-memoryInstalls for Copilot at project scope by default; add --scope user for a personal install. Preview a skill first with gh skill preview. Needs GitHub CLI 2.90.0 or later (public preview).
$ npx skills add ag2ai/build-with-ag2 --skill ag2-knowledge-and-memory -a github-copilotProject install goes to .agents/skills/; add -g for ~/.copilot/skills/.
$ git clone --depth 1 https://github.com/ag2ai/build-with-ag2.git skills-src && mkdir -p .github/skills && cp -r skills-src/.agents/skills/ag2-knowledge-and-memory .github/skills/ag2-knowledge-and-memory && rm -rf skills-srcUse ~/.copilot/skills/ instead of .github/skills for a personal install. Commit .github/skills so cloud agent and code review can use it.
GitHub Copilot skills documentation · loads skills from .github/skills/, .claude/skills/, .agents/skills/
Install the "ag2-knowledge-and-memory" agent skill from https://github.com/ag2ai/build-with-ag2/tree/main/.agents/skills/ag2-knowledge-and-memory into .github/skills/ag2-knowledge-and-memory/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "ag2-knowledge-and-memory", then confirm the skill loads.GitHub Copilot copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$ npx skills add ag2ai/build-with-ag2 --skill ag2-knowledge-and-memory -a opencodeOpenCode documents no install command of its own. Project install goes to .agents/skills/; add -g for ~/.config/opencode/skills/.
$ gh skill install ag2ai/build-with-ag2 ag2-knowledge-and-memory --agent opencodeProject scope by default (.agents/skills/); add --scope user for a personal install.
$ git clone --depth 1 https://github.com/ag2ai/build-with-ag2.git skills-src && mkdir -p .opencode/skills && cp -r skills-src/.agents/skills/ag2-knowledge-and-memory .opencode/skills/ag2-knowledge-and-memory && rm -rf skills-srcUse ~/.config/opencode/skills/ instead of .opencode/skills for a personal install.
OpenCode skills documentation · loads skills from .opencode/skills/, .claude/skills/, .agents/skills/
Install the "ag2-knowledge-and-memory" agent skill from https://github.com/ag2ai/build-with-ag2/tree/main/.agents/skills/ag2-knowledge-and-memory into .opencode/skills/ag2-knowledge-and-memory/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "ag2-knowledge-and-memory", then confirm the skill loads.OpenCode copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
ag2-knowledge-and-memoryPersist agent state across runs, shape what the LLM sees per turn, and cap history to fit a context window.
Ag2 Knowledge And Memory is an agent skill from ag2ai/build-with-ag2. Persist agent state across runs, shape what the LLM sees per turn, and cap history to fit a context window. Covers KnowledgeStore (memory / sqlite / disk / redis), KnowledgeConfig (store=, compact=, aggregate=, bootstrap=), aggregation strategies (WorkingMemoryAggregate, ConversationSummaryAggregate), assembly policies (WorkingMemoryPolicy, EpisodicMemoryPolicy, ConversationPolicy, SlidingWindowPolicy, TokenBudgetPolicy, AlertPolicy), and compaction (TailWindowCompact, SummarizeCompact). Use when the user wants…
Its SKILL.md is about 2.9k tokens, which your agent loads only when the skill is triggered. The skill folder holds 3 other files, including assets (for example `assets/journal_companion.py` and `assets/long_doc_chat.py`).
It sits in Databases, covering Context engineering. It works with Redis and SQLite. The repository describes itself as: Sample code and application showcases to get you going with AG2 (formally AutoGen). The licence is Apache-2.0.
Read from SKILL.md and the folder at commit 29eeac3. It shows what the files ask for, not the result of running them.
Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.
From allowed-tools in the SKILL.md frontmatter.
Ships script files (Python), which the agent can run.
From the folder's file list and the shell code blocks in SKILL.md.
No URLs in SKILL.md.
From URLs in SKILL.md, links to its own repository left out.
Names no API keys, tokens, secrets or passwords.
From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.
Ag2 Knowledge And Memory loads about 2.9k tokens when it runs. Until then it costs about 167 tokens; SKILL.md has 745 words of instructions outside code blocks.
Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.
The automated check found no risky patterns in SKILL.md.
Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.
The full file from ag2ai/build-with-ag2 at commit 29eeac3, republished under its Apache-2.0 licence (© ag2ai). 745 words, ~2,879 tokens.
.claude/skills/ag2-knowledge-and-memory/SKILL.md (or your agent's skills folder). This skill also uses 2 other files; get the full folder from GitHub.This skill covers three related primitives that work together:
| Primitive | Lives in | Role |
|---|---|---|
KnowledgeStore | autogen.beta.knowledge | Path-based persistent storage (memory / sqlite / disk / redis) |
| Assembly policies | autogen.beta.policies | Shape (prompts, events) per turn before the LLM call |
| Aggregation / Compaction | autogen.beta.aggregate / .compact | Write structured knowledge to the store / trim event history |
KnowledgeConfig wires all three onto an Agent via the knowledge= constructor parameter; assembly policies go via assembly=.
| User intent | Reach for |
|---|---|
| Remember user preferences / state between conversations | WorkingMemoryAggregate + WorkingMemoryPolicy (and a persistent store) |
| Summarise each session for next time | ConversationSummaryAggregate + EpisodicMemoryPolicy |
| Hard-cap event history sent to the LLM | SlidingWindowPolicy(max_events=N) |
| Cap by approximate token count | TokenBudgetPolicy(max_tokens=N) |
| Drop lifecycle / observer events from the LLM's view | ConversationPolicy() |
| Trim stream history (not just LLM view) | TailWindowCompact or SummarizeCompact |
| Route observer alerts to the LLM | AlertPolicy() |
from autogen.beta import Agent, KnowledgeConfig
from autogen.beta.aggregate import AggregateTrigger, WorkingMemoryAggregate
from autogen.beta.config import OpenAIConfig
from autogen.beta.knowledge import DiskKnowledgeStore
from autogen.beta.policies import ConversationPolicy, WorkingMemoryPolicy
store = DiskKnowledgeStore("./journal-state")
config = OpenAIConfig(model="gpt-5")
agent = Agent(
"journal",
prompt="You are a daily journal companion.",
config=config,
knowledge=KnowledgeConfig(
store=store,
aggregate=WorkingMemoryAggregate(config=config),
aggregate_trigger=AggregateTrigger(on_end=True),
),
assembly=[
WorkingMemoryPolicy(), # injects /memory/working.md on every LLM call
ConversationPolicy(),
],
)After each conversation the aggregate writes /memory/working.md. The next time you build an Agent against the same store, WorkingMemoryPolicy reads that file in and injects it as prompt context. The agent "remembers" without replaying chat history. Full runnable example: assets/journal_companion.py.
KnowledgeStore implementations| Implementation | Use when |
|---|---|
MemoryKnowledgeStore() | Tests, ephemeral sessions |
SqliteKnowledgeStore(path) | Single-process durability — pragmatic default |
DiskKnowledgeStore(path) | Files should be human-readable on disk |
RedisKnowledgeStore(url) | Multi-process / cross-host sharing |
LockedKnowledgeStore(inner, lock=...) | Wrap any store to serialize concurrent writers |
API (all async):
await store.write("/artifacts/report.md", "# Q3...")
text = await store.read("/artifacts/report.md")
children = await store.list("/") # immediate children, dirs end in '/'
await store.delete("/artifacts/old.md")
exists = await store.exists("/artifacts/report.md")
off = await store.append("/log/events.jsonl", '{"t":1}\n') # WAL-style
new_slice = await store.read_range("/log/events.jsonl", off) # only new bytes
sub = await store.on_change("/log/", on_change_callback)Pass AssemblyPolicy instances via assembly=[...]. The Agent wires an internal AssemblerMiddleware at the outermost middleware position. Each policy transforms (prompts, events) and pipes into the next.
Two kinds of policy — order matters: injection before reduction.
| Kind | Purpose | Built-ins |
|---|---|---|
| Injection | Add to prompts | WorkingMemoryPolicy, EpisodicMemoryPolicy, AlertPolicy |
| Reduction | Trim events | ConversationPolicy, SlidingWindowPolicy, TokenBudgetPolicy |
Validate ordering manually:
from autogen.beta.assembly import AssemblerMiddleware
warnings = AssemblerMiddleware.validate_order(policies) # returns list of warnings on known bad orderings(AssemblerMiddleware and the AssemblyPolicy protocol live in autogen.beta.assembly for advanced/manual harness wiring; you don't need to import them when just passing built-in policies via assembly=[...].)
from autogen.beta.policies import (
AlertPolicy,
ConversationPolicy,
EpisodicMemoryPolicy,
SlidingWindowPolicy,
TokenBudgetPolicy,
WorkingMemoryPolicy,
)
# Injection
WorkingMemoryPolicy() # reads /memory/working.md
EpisodicMemoryPolicy(max_episodes=5, transparent=True) # reads recent /memory/conversations/
AlertPolicy() # delivers ObserverAlerts to LLM, halts on FATAL
# Reduction
ConversationPolicy() # drops non-conversation events
SlidingWindowPolicy(max_events=50, transparent=True) # last N events
TokenBudgetPolicy(max_tokens=32_000, chars_per_token=4, transparent=True)transparent=True appends a [policy_name] Showing X of Y events. note to the prompt — useful while tuning. Realistic chain:
assembly=[
WorkingMemoryPolicy(),
EpisodicMemoryPolicy(max_episodes=3),
AlertPolicy(),
SlidingWindowPolicy(max_events=80),
]AggregateStrategy.aggregate(events, ctx, store) → None extracts and persists. Two built-ins, both take a ModelConfig for a summarisation call (use a cheaper model than the agent's main one):
| Strategy | Writes | Pairs with |
|---|---|---|
WorkingMemoryAggregate(config=...) | /memory/working.md (single rolling file) | WorkingMemoryPolicy |
ConversationSummaryAggregate(config=...) | /memory/conversations/{ts}_{stream_id}.md | EpisodicMemoryPolicy |
AggregateTrigger controls cadence — every_n_turns, every_n_events, on_end. AggregateTrigger() alone fires nothing; opt in to at least one. on_end=True defaults off because each fire is an LLM call.
CompactStrategy.compact(events, ctx, store) → list[BaseEvent]. Replaces the stream's history. Two built-ins:
| Strategy | Behaviour | Cost |
|---|---|---|
TailWindowCompact(target=N) | Keep last N events; drop the rest (optionally persist to /log/) | Zero LLM calls |
SummarizeCompact(target=N, config=...) | Summarise dropped events into one CompactionSummary; insert at head | One LLM call per fire |
CompactTrigger(max_events=N, max_tokens=M, chars_per_token=4) — fires when any threshold is crossed.
from autogen.beta.compact import CompactTrigger, TailWindowCompact, SummarizeCompactSummarizeCompact inserts a CompactionSummary event at the head; ConversationPolicy allows it through so the LLM still gets that context.
KnowledgeConfig is the bundle:
from dataclasses import dataclass
@dataclass
class KnowledgeConfig:
store: KnowledgeStore
compact: CompactStrategy | None = None
compact_trigger: CompactTrigger | None = None
aggregate: AggregateStrategy | None = None
aggregate_trigger: AggregateTrigger | None = None
bootstrap: StoreBootstrap | None = None # e.g. DefaultBootstrap()Full shape:
agent = Agent(
"assistant",
config=main_config,
knowledge=KnowledgeConfig(
store=DiskKnowledgeStore("./state"),
compact=TailWindowCompact(target=100),
compact_trigger=CompactTrigger(max_events=200),
aggregate=ConversationSummaryAggregate(config=summarizer_config),
aggregate_trigger=AggregateTrigger(every_n_turns=10, on_end=True),
bootstrap=DefaultBootstrap(), # seeds /SKILL.md, /artifacts/, /log/, /memory/
),
assembly=[
WorkingMemoryPolicy(),
EpisodicMemoryPolicy(max_episodes=3),
AlertPolicy(),
SlidingWindowPolicy(max_events=80),
],
)The harness wires internal middleware conditionally — _AssemblerMiddleware, _HaltCheckMiddleware, _CompactionMiddleware, _AggregationMiddleware. You only pay for what you turn on.
Lifecycle events emitted: CompactionCompleted (with events_before / events_after / usage), AggregationCompleted (with strategy / usage), HaltEvent (when AlertPolicy sees a FATAL alert). Subscribe via ag2-observers-and-alerts.
assets/journal_companion.py — runnable end-to-end working-memory demo (mirrors code_examples/06).assets/long_doc_chat.py — assembly + compaction stress test (mirrors code_examples/07).website/docs/beta/advanced/knowledge_store.mdx — store API, EventLogWriter, LockedKnowledgeStore.website/docs/beta/advanced/assembly.mdx — full policy reference and ordering rules.website/docs/beta/advanced/aggregation.mdx — aggregate strategies and custom strategies.website/docs/beta/advanced/compaction.mdx — compact strategies and custom strategies.website/docs/beta/agent_harness.mdx — KnowledgeConfig constructor reference, turn-lifecycle middleware order.SlidingWindowPolicy before WorkingMemoryPolicy means the working memory injection isn't counted against the budget. Always: injections first, then AlertPolicy, then reductions.KnowledgeStore dependency for memory policies — WorkingMemoryPolicy and EpisodicMemoryPolicy look up the store via context.dependencies.get(KnowledgeStore). KnowledgeConfig(store=...) registers it for you; if you wire the policy manually, register the store in dependencies too.on_end=True on every conversation can add up. Pair WorkingMemoryAggregate and ConversationSummaryAggregate thoughtfully; consider every_n_turns=N for high-volume agents.HistoryLimiter middleware with assembly reduction policies — they both trim. Pick one mechanism. Assembly is more flexible (rich shaping, transparency notes); HistoryLimiter is simpler.read_range operates on byte offsets, not character offsets — multi-byte UTF-8 sequences need careful alignment.WorkingMemoryAggregate is destructive — it overwrites /memory/working.md each fire. That's intentional (rolling state, not log) but expect prior content to merge or disappear.AlertPolicy to render alerts to the LLM without being in assembly= — alerts sit on the stream as ObserverAlert events but only reach the LLM when AlertPolicy injects them.© ag2ai, Apache-2.0. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file
SKILL.md and 2 other files (assets) in .agents/skills/ag2-knowledge-and-memory of ag2ai/build-with-ag2.
Open the folder on GitHubat commit 29eeac3
Ag2 Knowledge And Memory next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.
| Skill | Stars | Used in | Tokens | Auto-check | Licence | Repo updated |
|---|---|---|---|---|---|---|
| Ag2 Knowledge And Memory this skillag2ai/build-with-ag2 | 252 | — | ~2.9k | Automated safety check: Pass | Apache-2.0 | |
| Cognee Session Memory and Improvetopoteretes/cognee | 32k | — | ~3.2k | Automated safety check: Pass | Apache-2.0 | |
| Frontmcp Setupagentfront/frontmcp | 146 | — | ~5.8k | Automated safety check: Pass | Apache-2.0 | |
| Add Memory KindEverMind-AI/EverOS | 13k | — | ~2.6k | Automated safety check: Pass | Apache-2.0 | |
| Extend Commands APIredis/lettuce | 5.8k | — | ~7.7k | Automated safety check: Notes | MIT | |
| Extend Commands APIredis/jedis | 12k | — | ~7.2k | Automated safety check: Warn | MIT |
topoteretes/cognee
Explains how cognee stores session memory by session_id and bridges it into the permanent graph with improve(), including the stages, results and settings.
agentfront/frontmcp
A skill your agent uses when starting, scaffolding, or organizing a FrontMCP project.
EverMind-AI/EverOS
Walks through adding a new persisted memory kind to EverOS: choose storage among Markdown, SQLite and LanceDB, pick a Markdown strategy, then wire schemas, repos and writers.
redis/lettuce
Add or extend Redis commands in the Lettuce client API end-to-end — a new core command, a family of new commands, an extension to an existing command's options, or a module/area command…
redis/jedis
Add or extend Redis commands in the Jedis client API — a new core command, a family of new commands, an extension to an existing command's options, or a module command (Search/TimeSeries/JSON/Bloom).
mvanhorn/printing-press-library
Agent-native admin CLI for authentik identity provider with offline SQLite cache and an MCP server for Claude Desktop.
ag2ai/build-with-ag2
Add a custom Python tool to an AG2 beta Agent using the @tool decorator.
ag2ai/build-with-ag2
Intercept the AG2 beta agent loop with BaseMiddleware — wrap full turns (onturn), each LLM call (onllmcall), each tool execution (ontoolexecution), or each human-input request (onhumaninput).
ag2ai/build-with-ag2
Wire AG2 beta's shipped tools into an Agent — both provider-native server-side tools (web search, web fetch, code execution, MCP, image generation, memory) and locally-executed common toolkits…
ag2ai/build-with-ag2
Monitor an AG2 beta agent's stream — log events, detect repeated tool calls, track token spend, build trigger-driven observers, route observer alerts to the model, and halt on FATAL conditions.
ag2ai/build-with-ag2
Build a minimal AG2 beta Agent end to end — pick a model provider, set a prompt, call agent.ask(), then continue the conversation with reply.ask() (multi-turn).
ag2ai/build-with-ag2
Get a typed Python value back from an AG2 beta Agent instead of free text.
Categories
Persist agent state across runs, shape what the LLM sees per turn, and cap history to fit a context window. Ag2 Knowledge And Memory is an agent skill from ag2ai/build-with-ag2. Persist agent state across runs, shape what the LLM sees per turn, and cap history to fit a context window.
Ag2 Knowledge And Memory fits situations like: the user wants the agent to remember between conversations; manage long histories; control prompt assembly.
Run `npx skills add ag2ai/build-with-ag2 --skill ag2-knowledge-and-memory -a claude-code`. Or copy the skill folder (.agents/skills/ag2-knowledge-and-memory in ag2ai/build-with-ag2) into .claude/skills/ag2-knowledge-and-memory in your project. Claude Code loads it when a task matches its description.
Run `npx skills add ag2ai/build-with-ag2 --skill ag2-knowledge-and-memory -a codex`. Or copy the skill folder (.agents/skills/ag2-knowledge-and-memory in ag2ai/build-with-ag2) into .agents/skills/ag2-knowledge-and-memory in your project. Codex loads it when a task matches its description.
Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add ag2ai/build-with-ag2 --skill ag2-knowledge-and-memory -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/ag2-knowledge-and-memory, .gemini/skills/ag2-knowledge-and-memory, .github/skills/ag2-knowledge-and-memory and .opencode/skills/ag2-knowledge-and-memory in your project.
Going by SKILL.md and its folder, Ag2 Knowledge And Memory needs Python for the scripts in its folder. Our summary lists: Python 3.
SKILL.md contains no URLs. Any network use would come from the scripts or tools the agent runs. This is read from the text; nothing was executed.
Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. Review the folder before installing.
Ag2 Knowledge And Memory is published under the Apache-2.0 licence (declared in SKILL.md). It allows redistribution, so the full SKILL.md is shown on this page.
About 2.9k tokens (SKILL.md is roughly 12k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full.
Skills that share tags, products or a category with Ag2 Knowledge And Memory: Cognee Session Memory and Improve (topoteretes/cognee, 32k stars), Frontmcp Setup (agentfront/frontmcp, 146 stars), Add Memory Kind (EverMind-AI/EverOS, 13k stars) and Extend Commands API (redis/lettuce, 5.8k stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.
ag2ai (a GitHub organization) maintains it in ag2ai/build-with-ag2, which has 252 GitHub stars. The repository holds 16 skills in this directory. The repository was last updated on September 6, 2026.
Source: ag2ai/build-with-ag2 on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.