memory-knowledge-and-rag
Guides agents using CrewAI memory, knowledge sources, RAG clients and loaders, embedding providers, vector stores, reset-memory commands, and optional retrieval dependencies.
- License 许可
- MIT
- 最近更新
- 2026-09-03
- Stars
- ★ 351
- Forks
- 27
01 前言 Front Matter
- name
- memory-knowledge-and-rag
- license
- MIT
- metadata
- { "disco-role": "operating" }
- description
- Guides agents using CrewAI memory, knowledge sources, RAG clients and loaders, embedding providers, vector stores, reset-memory commands, and optional retrieval dependencies.
- disable-model-invocation
- true
02 资源文件 5
- 参考文档references/embedding-and-storage.md9.2 KB
- 参考文档references/memory-and-knowledge.md10.5 KB
- 参考文档references/rag-loaders.md9.6 KB
- 参考文档references/troubleshooting.md10.6 KB
- 脚本scripts/check_rag_imports.py8.1 KB
03 SKILL.md 正文
Memory, Knowledge, and RAG
Use this sub-skill when work involves CrewAI Memory, Knowledge, knowledge_sources, memory scopes/slices, RAG vector clients, RagTool, official RAG loaders, embedding providers, ChromaDB/Qdrant/LanceDB storage, or crewai reset-memories behavior.
Route First
- For memory construction, recall depth, scopes, slices, crew/agent memory behavior, and reset commands, read references/memory-and-knowledge.md.
- For
Knowledge,knowledge_sources, crew-level vs agent-level knowledge, source classes, storage collections, and score thresholds, read references/memory-and-knowledge.md. - For direct RAG clients,
RagTool, data type detection, official loaders, and network/file loader boundaries, read references/rag-loaders.md. - For embedding provider specs, vector DB configuration, LanceDB/ChromaDB/Qdrant storage defaults, optional dependencies, and dimension-mismatch prevention, read references/embedding-and-storage.md.
- For common failures and fixes, including embedder dimension mismatch, missing optional dependencies, storage path confusion, reset target confusion, unsupported file types, and credential-bound loaders, read references/troubleshooting.md.
- To safely check installed memory, knowledge, RAG, and optional loader imports without LLMs, credentials, network, or destructive operations, run scripts/check_rag_imports.py with
--helpfirst.
Boundaries
- Stay here for retrieval architecture:
Memory,Knowledge,RagTool, RAG clients, vector stores, embedders, loaders, reset commands, and optional retrieval dependencies. - Use ../files-and-multimodal/SKILL.md for low-level file input resolution, MIME/provider constraints, multimodal task files, and non-RAG file processing.
- Use ../tools-and-mcp/SKILL.md for general tool wrappers, custom
BaseTooldesign, MCP, and non-RAGcrewai_toolsexports. - Use ../llm-and-providers/SKILL.md for LLM provider credentials, model IDs, base URLs, streaming, and chat/completion auth.
- Use ../core-runtime/SKILL.md for
Agent,Task,Crew, kickoff, process, guardrail, callback, and output design that happens around retrieval. - Return to ../../SKILL.md when a request spans multiple CrewAI capability areas and needs root routing context.
Safe Defaults
- Prefer local
StringKnowledgeSource,TextFileKnowledgeSource, JSON/CSV sources, or localRagTool.add(path=...)when the user has not approved network retrieval. - Do not instantiate loaders that fetch web pages, GitHub repositories, YouTube transcripts, or databases unless the user authorizes network/database access and provides credentials if needed.
- Keep embedding provider secrets in runtime environment or user config; never put real API keys, tokens, database URIs, or full local storage paths in generated content.
- Use one embedding model per existing collection. If the embedder changes, reset or rebuild the relevant memory/knowledge/RAG collection rather than mixing vector dimensions.
Usability Targets
- Diagnose a dimension mismatch after changing embedding providers and choose the smallest safe reset/rebuild target.
- Build a knowledge-enabled crew with local document loaders while avoiding accidental network retrieval.
04 同仓库更多 Skills
passnet-triton-opt
Make a single PassNet Triton kernel fast AND numerically faithful: performance model (when a replacement can win at all), block/grid/warp tuning, autotune policy, launch overhead, and per-op numeric recipes to pass the dtype baseline tolerances. Use when a pass matches and is correct but speedup below expected, or when correctness fails by small numeric margins.
passnet-solve
END-TO-END playbook for solving one PassNet sample: analyze the computation graphs, decide the optimization strategy (what to fuse, what to replace, what to leave alone), drive the iteration loop, and maximize the sample score. This is the ENTRY skill — invoke it first for any PassNet optimization task; it tells you when to use passnet-pattern-fusion, passnet-triton-opt and passnet-feedback.
passnet-skill
PassNet GPU kernel optimization via compiler passes. Design and implement Triton-based optimization passes, create pass files under ./pass_dir/, self-evaluate with pass_evaluator, and iterate to maximize GPU speedup.
passnet-pattern-fusion
Author PassNet pass files: write patterns that actually MATCH the FX graph, pick fusion regions (which ops to absorb into one Triton kernel), and structure multi-pass submissions with the mandatory shared-dispatch architecture. Use when creating or fixing pattern()/replacement_args()/replacement_func() files, when a pass "failed to match", or when deciding how to fuse multiple kernels/ops.
passnet-orchestrate
Round/batch planning and decision support for PassNet graph optimization. Use for multi-sample triage, worker allocation, eval-budget policy, and post-eval keep/revert decisions. For solving one concrete sample end to end, use passnet-solve as the entry skill; consult this skill only when you need broader planning or a specific decision gate.
passnet-feedback
Fast, deterministic feedback for PassNet work: pre-flight pattern/match verification WITHOUT burning a GPU evaluation, per-node bottleneck analysis of a sample's graphs, and eval-log parsing into per-variant status + estimated score + failure classification. Use BEFORE every GPU evaluation (check_pattern), at the START of a sample (analyze_graph), and AFTER every evaluation (parse_eval_log).