Skip to main content

ai-agent-integration

Advanced skill for implementing Large Language Model (LLM) features into applications, covering tool calling, Retrieval-Augmented Generation (RAG), prompt caching, and context management.

Datos de origen

Repositorio
skeletorflet/opencode-kit
Última actividad en el origen
1 de abril de 2026 a las 13:09
Idioma detectado de SKILL.md
inglés
Estrellas
9
Forks
1

Opciones de instalación

De forma predeterminada está seleccionado el prompt que primero revisa el origen. Puedes cambiar a un comando directo o descargar una copia local.

Revisa los archivos de origen

Lee SKILL.md y los archivos complementarios que muestra SkillsMP antes de decidir si quieres instalarlo.

Mostrando SKILL.md

SKILL.md
Instrucciones de origen · Vista previa de solo lectura
name
ai-agent-integration
description
Advanced skill for implementing Large Language Model (LLM) features into applications, covering tool calling, Retrieval-Augmented Generation (RAG), prompt caching, and context management.
# AI Agent Integration Patterns This skill file documents best practices for integrating autonomous agents, chatbots, and generative AI features into enterprise architectures (2026 specs). ## 1. Tool Calling (Function Calling) When implementing tool calling for AI models (e.g., using `openai`, `anthropic`, or standard `LangChain` wrappers): - **Deterministic Names:** Use clear, hyphenated or snake_case tool names (e.g., `get_weather_data`). - **Strict Zod/Pydantic Schemas:** Always back tool parameters with explicit schema validation. Do not trust the LLM to output perfect JSON. - **Fail Gracefully:** Inform the LLM if a tool call fails. Provide the stack trace or a summary back as the tool output message so the model can auto-correct. ## 2. RAG Architectures (Retrieval-Augmented Generation) - **Vector Stores:** Favor standalone vector DBs (like Pinecone, Weaviate) or Postgres + `pgvector` for embedding storage. - **Chunking Strategy:** Chunk documents semantically (by headers or paragraphs), not blindly by character count. Add metadata (e.g., source file, author) to chunks for filtering. - **Hybrid Search:** Always implement a hybrid search approach (Dense Vector + BM25 Lexical search) to retrieve both high-level semantic matches and exact keyword matches. ## 3. Context & Prompt Management - **Prompt Caching:** Optimize Anthropic or OpenAI API usage natively by anchoring static system prompts. Organize messages sequentially without injecting dynamic timestamps frequently into system instructions to prevent cache eviction. - **Sliding Windows:** Maintain a bounded conversation history. Discard messages older than a specific turn threshold or token limit and inject an AI-generated summary back into the context. ## 4. Multi-Agent Orchestration - When architecting multiple agents (like the `.opencode` architecture), define strict boundaries. Use a "Project Planner" agent to create an execution plan, and specialized agents limited in scope to execute individual steps.
Ver en GitHub