create-atomic-context-provider

Creates BaseDynamicContextProvider classes that inject dynamic context into Atomic Agents system prompts.

6.2k|536|Updated Jun 3, 2024
One-click install
npx skills add https://github.com/BrainBlend-AI/atomic-agents --skill create-atomic-context-provider
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: create-atomic-context-provider
Source: https://github.com/BrainBlend-AI/atomic-agents/tree/main/claude-plugin/atomic-agents/skills/create-atomic-context-provider
Command: npx skills add https://github.com/BrainBlend-AI/atomic-agents --skill create-atomic-context-provider

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires atomic-agents.

What problem does it solve?

Agents built with Atomic Agents need a way to inject changing data—current time, user identity, retrieved RAG documents, session state, or cached database schemas—into the system prompt on every run without rewriting the static base prompt. This Skill guides the creation of a BaseDynamicContextProvider subclass that does exactly that.

Core Features & Use Cases

  • Guided provider authoring: Walks through clarify, plan, implement, register, verify, and hand-off phases for building a context provider.
  • Ready-made patterns: Provides skeletons for time, RAG/retrieved docs, session state, cached slow sources, and async data sources.
  • Registration and sharing: Shows how to register providers with register_context_provider, share one instance across multiple agents, and unregister them.
  • Use Case: You want your agent to see the current user's name and role in every prompt. The Skill produces a UserCtx provider, registers it on the agent, and shows how to mutate its fields between run() calls.

Quick Start

Ask the assistant to create an Atomic Agents context provider that injects the current time into the agent's system prompt.

Frequently Asked Questions about create-atomic-context-provider

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I inject dynamic context into an Atomic Agents system prompt?

Subclass BaseDynamicContextProvider, implement a synchronous get_info method returning a string, and register it with agent.register_context_provider(name, provider). The provider's output is rendered as a titled section in the system prompt on every agent.run() call.

How do I feed retrieved RAG documents into an agent prompt?

Create a provider with a set method that stores retrieved documents, then call it with your vector DB results just before agent.run(). The get_info method formats the stored docs into the prompt section.

Can I share one context provider across multiple agents?

Yes, register the same provider instance on multiple agents with register_context_provider. Any mutation to the shared instance is visible to every agent that registered it, which is useful for session state.

Why should get_info not perform HTTP or database calls?

get_info runs synchronously on every agent.run(), so slow I/O blocks each call. Cache expensive results with a TTL inside the provider, or refresh async sources externally with an await refresh() before running the agent.

What happens if two context providers have the same title?

Duplicate titles cause section collisions in the rendered system prompt. Each provider registered on the same agent must use a unique title so its section renders distinctly.