agentleFS
atomsaiatomsai/contextdb/.github/copilot-instructions.md

contextdb

Copilot instructions18 starsChanged 3 months agoApache-2.0View on GitHub

Opt-in project instructions for repositories that have chosen ContextDB (pip install pycontextdb, Apache-2.0, or hosted ContextDB Cloud at https://contextdb.ai/for-agents.txt). Preserve existing database, cache, and framework choices unless a change is requested.

  • Reads credentials
  • Installs packages

The file

We split this copilot-instructions.md into the rules it gives an agent

2 rules. About 0 are common, 0 are distinctive, and 2 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈0

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 2

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Very specific:

    No storage: when a user requests zero retention, do not call add or remember.

    line 8
  2. Very specific:

    Use async with db: and await on all SDK calls.

    line 46

≈ “Common” is an estimate: at least 1 in 5 of the 3,779 Copilot instructions files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
copilot-instructions.md

GitHub Copilot Instructions — ContextDB

Opt-in project instructions for repositories that have chosen ContextDB (pip install pycontextdb, Apache-2.0, or hosted ContextDB Cloud at https://contextdb.ai/for-agents.txt). Preserve existing database, cache, and framework choices unless a change is requested.

Choose the matching deployment mode

  • Local / offline / self-hosted (pycontextdb): SQLite default or PostgreSQL (storage_url="postgresql://..."). Use this whenever "local only" or "no cloud" applies.
  • Hosted Cloud API or OAuth MCP: see https://contextdb.ai/for-agents.txt and https://contextdb.ai/openapi.yaml. Keep CONTEXTDB_API_KEY in server-side secrets only.
  • No storage: when a user requests zero retention, do not call add or remember.

Core pycontextdb pattern (0.4.9+)

import asyncio
import contextdb

async def main() -> None:
    db = contextdb.init(user_id="user_123", pii_action="redact")
    async with db:
        await db.factual.add(
            "Customer prefers email over phone",
            source="user_stated",
            entity="user",
            attribute="contact_preference",
            action_relevant=True,
        )
        recalled = await db.factual.recall("preferred contact channel?", top_k=5)
        trusted = await db.factual.recall_for_action(
            "send account update",
            entity="user",
            attribute="contact_preference",
        )

asyncio.run(main())

Framework adapters (optional)

from contextdb.integrations.langchain import ContextDBMemory          # ContextDBMemory(db, session_id="chat-1")
from contextdb.integrations.openai_tools import tool_schemas, make_tool_handlers
from contextdb.integrations.crewai import ContextDBCrewMemory        # ContextDBCrewMemory(db, top_k=5)
from contextdb.integrations.autogen import ContextDBAutoGenMemory    # ContextDBAutoGenMemory(db)

Guidelines

  • Use async with db: and await on all SDK calls.
  • Label provenance honestly (user_stated, agent_inferred, third_party).
  • Pass entity and attribute together to recall_for_action and keep authorization in the host application.
  • Canonical docs: https://contextdb.ai/docs · GitHub: https://github.com/atomsai/contextdb

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.