Community编程与开发github.com

sickn33/conversation-memory

为LLM对话提供持久化记忆系统,包括短期记忆、长期记忆和基于实体的记忆。

conversation-memory 是什么?

该技能为大型语言模型(LLM)对话提供多层次的持久化记忆系统,支持短期记忆、长期记忆以及基于实体的记忆管理。短期记忆负责维护当前对话上下文的临时缓存,长期记忆则通过向量数据库(如 Chroma、FAISS)实现语义检索,确保跨会话的信息持久化。实体记忆模块能够从对话中自动提取和关联命名实体(如人名、地点、日期),构建结构化的知识图谱,支持后续查询。技能通过 Python 实现,兼容多种 LLM 平台(如 LangChain、AutoGPT),采用 SQLite 或 Redis 作为后端存储,开发者可通过简单的 API 调用来读写记忆,无需手动管理状态,从而显著提升对话系统的连贯性和个性化体验。

兼容平台~Claude Code~Codex CLI~Cursor
npx skills add https://github.com/sickn33/antigravity-awesome-skills/tree/main/skills/conversation-memory

Installed? Explore more 编程与开发 skills: steipete/bluebubbles, steipete/eightctl, steipete/blucli · View all 6 →

在你喜欢的 AI 中提问

打开一个已预加载此 Agent Skill 的新对话。

文档

conversation-memory 是做什么的?

为LLM对话提供持久化记忆系统,包括短期记忆、长期记忆和基于实体的记忆。

概述

该技能通过分层架构管理对话中的信息:

  • 短期记忆:基于令牌数或时间窗口自动过期,用于保持当前会话上下文。
  • 长期记忆:将用户陈述嵌入到向量空间中,通过语义相似度检索相关记忆。
  • 实体记忆:使用命名实体识别(NER)提取实体,并存储实体关系图。

使用方法

from conversation_memory import MemoryManager

# 初始化记忆管理器
mem = MemoryManager(storage="sqlite", embedding_model="all-MiniLM-L6-v2")

# 添加记忆
mem.add_short_term(session_id="sess_1", content="用户偏好咖啡而非茶")
mem.add_long_term(user_id="user_1", content="上次订购了拿铁")

支持平台

  • LangChain
  • AutoGPT
  • 自定义Python应用

后端存储选项

存储类型启动命令适用场景
SQLite默认内嵌单机小规模部署
Redisredis-server需要低延迟访问
Chromachroma run高维度语义搜索

配置

设置环境变量 MEMORY_BACKEND(取值:sqlite、redis、chroma)和 EMBEDDING_MODEL。

示例

长期记忆检索

memories = mem.query_long_term("咖啡偏好", top_k=5)
for mem_obj in memories:
    print(mem_obj.text)

实体查询

entities = mem.get_related_entities(entity="Alice")
# 返回包含Alice及相关实体的结构化数据

开发者说明

无需手动管理状态,所有记忆操作通过API完成。API参考文档见 docs/api.md。

许可证

MIT

Individual skills in this repo

This repo contains 20 individual skills — each has its own dedicated page.

sickn33/3d-web-experience

Expert in building 3D experiences for the web - Three.js, React Three Fiber, Spline, WebGL, and interactive 3D scenes. Covers product configurators, 3D portfolios, immersive websites, and bringing depth to web experiences.

sickn33/agent-memory-mcp

A hybrid memory system that provides persistent, searchable knowledge management for AI agents (Architecture, Patterns, Decisions).

sickn33/agent-memory-systems

Memory is the cornerstone of intelligent agents. Without it, every interaction starts from zero. This skill covers the architecture of agent memory: short-term (context window), long-term (vector stores), and the cognitive architectures that organize them.

sickn33/ai-agents-architect

Expert in designing and building autonomous AI agents. Masters tool use, memory systems, planning strategies, and multi-agent orchestration.

sickn33/api-documentation-generator

Generate comprehensive, developer-friendly API documentation from code, including endpoints, parameters, examples, and best practices

sickn33/api-patterns

API design principles and decision-making. REST vs GraphQL vs tRPC selection, response formats, versioning, pagination.

sickn33/api-security-best-practices

Implement secure API design patterns including authentication, authorization, input validation, rate limiting, and protection against common API vulnerabilities

sickn33/app-store-optimization

Complete App Store Optimization (ASO) toolkit for researching, optimizing, and tracking mobile app performance on Apple App Store and Google Play Store

sickn33/architecture

Architectural decision-making framework. Requirements analysis, trade-off evaluation, ADR documentation. Use when making architecture decisions or analyzing system design.

sickn33/audio-transcriber

Transform audio recordings into professional Markdown documentation with intelligent summaries using LLM integration

sickn33/aws-serverless

Specialized skill for building production-ready serverless applications on AWS. Covers Lambda functions, API Gateway, DynamoDB, SQS/SNS event-driven patterns, SAM/CDK deployment, and cold start optimization.

sickn33/backend-architect

Expert backend architect specializing in scalable API design, microservices architecture, and distributed systems.

sickn33/backend-dev-guidelines

You are a senior backend engineer operating production-grade services under strict architectural and reliability constraints. Use when routes, controllers, services, repositories, express middleware, or prisma database access.

sickn33/bash-linux

Bash/Linux terminal patterns. Critical commands, piping, error handling, scripting. Use when working on macOS or Linux systems.

sickn33/bash-scripting

Bash scripting workflow for creating production-ready shell scripts with defensive patterns, error handling, and testing.

sickn33/brainstorming

Use before creative or constructive work (features, architecture, behavior). Transforms vague ideas into validated designs through disciplined reasoning and collaboration.

sickn33/browser-automation

Browser automation powers web testing, scraping, and AI agent interactions. The difference between a flaky script and a reliable system comes down to understanding selectors, waiting strategies, and anti-detection patterns.

sickn33/browser-extension-builder

Expert in building browser extensions that solve real problems - Chrome, Firefox, and cross-browser extensions. Covers extension architecture, manifest v3, content scripts, popup UIs, monetization strategies, and Chrome Web Store publishing.

sickn33/bullmq-specialist

BullMQ expert for Redis-backed job queues, background processing, and reliable async execution in Node.js/TypeScript applications.

sickn33/bun-development

Fast, modern JavaScript/TypeScript development with the Bun runtime, inspired by [oven-sh/bun](https://github.com/oven-sh/bun).

相关技能