ai-vector-brain

ai-vector-brain is a skill for Codex from vasilyu1983/AI-Agents-public. It costs 40 tokens per session (5,453 once invoked), scanned A, original, MIT.

A guide for building a searchable knowledge system from repositories, documentation, policies, or other text collections, using PostgreSQL with pgvector by default. Such a system retrieves relevant passages so an AI system can use them as context.

In plain words
What is it for?
Use it to plan and create database schemas, ingestion scripts, document manifests, evaluation examples, and the interface an agent uses to retrieve information.
Why use it?
It turns a large document collection into a repeatable retrieval layer instead of relying on manually pasted information or unsupported answers.

Skill for Codex

Written for Codex: agents/openai.yaml present. Also seen: mentions Claude Code; mentions Codex.

Good fit Use it to plan and create database schemas, ingestion scripts, document manifests, evaluation examples, and the interface an agent uses to retrieve information.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/vasilyu1983/ai-agents-public/ai-vector-brain
Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Any agent
npx skills add vasilyu1983/AI-Agents-public --skill ai-vector-brain
Clone the repo
git clone --depth 1 https://github.com/vasilyu1983/AI-Agents-public

Made for: Codex.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for ai-vector-brain

README.md
[![agentmods](https://agentmods.dev/badge/skills/vasilyu1983/ai-agents-public/ai-vector-brain/github.svg)](https://agentmods.dev/skills/vasilyu1983/ai-agents-public/ai-vector-brain)
Your own site
<a href="https://agentmods.dev/skills/vasilyu1983/ai-agents-public/ai-vector-brain"><img src="https://agentmods.dev/badge/skills/vasilyu1983/ai-agents-public/ai-vector-brain/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for ai-vector-brain

Your own site · 80×15
<a href="https://agentmods.dev/skills/vasilyu1983/ai-agents-public/ai-vector-brain"><img src="https://agentmods.dev/badge/skills/vasilyu1983/ai-agents-public/ai-vector-brain.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 40 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 5,453 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe. Third-party audits
  • NVIDIA SkillSpector pass 7 Sept 2026
How audits are shown
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00040 $0.05453
Opus 5 $0.00020 $0.02727
Sonnet 5 $0.00008 $0.01091
Haiku 4.5 $0.00004 $0.00545

Measured 12d ago against content hash a243df011bf4, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-11, from the pricing page.

Security

Grade A, and why

ai-vector-brain scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 12d ago.

The scan reads SKILL.md. This mod also ships 13 executable files (scripts/build_eval_seed.py, scripts/build_vector_hub.sh, scripts/check_brain_manifest.py, …), listed below but not scanned — reading those needs a real analyzer, not pattern matching.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

frameworks/shared-skills/skills/ai-vector-brain/SKILL.md · 248 lines

How it starts

The opening of the file, as written. The whole thing — 248 lines — stays where its author put it; the contents beside it link to each section on GitHub.

AI Vector Brain

Build a vector brain implementation. V1 default: Postgres + pgvector. Pick a corpus playbook.

Use this skill when the user asks to:

  • build a vector brain, RAG brain, LLM brain, repo brain, docs brain, or compliance brain
  • turn a repo, docs hub, policy corpus, guide set, or generated context artifacts into a repeatable retrieval layer
  • choose a vector-brain backend and produce a concrete implementation path
  • create SQL, manifests, ingestion scripts, eval seeds, or an agent retrieval tool contract

Boundary Contract

Skill Owns Does Not Own
ai-context-layer Where context lives: memory vs retrieval vs tools, grounding, provenance, lifecycle, app context architecture Paste-ready SQL, vector DB schemas, embedding pipelines, ingest scripts
ai-rag Retrieval theory: chunking principles, hybrid fusion concepts, reranking concepts, eval theory, when retrieval is wrong Operational DDL, backend-specific SQL, concrete ingest scripts
ai-agents Agent topology, tool use, planner/critic flows, agent vs workflow decisions Retrieval backend implementation
ai-bot-builder Bot UX, conversation flows, escalation, channel integration, KB use in a bot surface KB/vector-brain construction
ai-vector-brain How to build: corpus inventory, manifests, DDL, ingest scripts, embeddings, hybrid search, eval seeds, backend recipes Broad RAG theory, app context strategy, agent topology, bot UX

Quick Reference

Need Start Here
Decide vector vs relational vs graph (upstream choice) ../software-database-design/SKILL.md#storage-paradigm-matrix-relational-vs-graph-vs-vector
Build the default brain references/postgres-pgvector-default.md
Choose backend (matrix + decision flow) references/backend-selection.md
Per-backend deep dive (S3 Vectors, Turbopuffer, Pinecone Serverless, Bedrock KB, OpenSearch, Vertex, Azure, edge) references/backend-selection-extended.md
S3 Vectors cost, limits (2B vectors/index GA limit, 14-region GA Dec 2025), direct API vs Bedrock KB references/s3-vectors-backend.md
Estimate cost (formulas, sizing, worked examples for hot vs object-backed vs managed) references/cost-calculation.md
Pick corpus recipe references/corpus-playbooks.md
Define portable manifest references/framework.md
Expose brain to agents references/agent-tool-contract.md
Choose eval gates references/eval-by-corpus-type.md
Prove retrieval before ANN ../ai-rag/scripts/exact_search_baseline.py + ../ai-rag/assets/eval/golden-retrieval-cases.jsonl
Compare backends fairly ../ai-rag/references/backend-comparison-fixtures.md
Trace production retrieval ../ai-rag/references/observability-tracing-contract.md
Debug quality drops ../ai-rag/references/retrieval-debugging-runbook.md
Red-team retrieval security ../ai-rag/references/security-red-team-cases.md
Lift retrieval with contextual summaries references/contextual-retrieval.md
Add cross-encoder reranking references/reranking-recipe.md
Decide the retrieval leg (lexical vs vector vs hybrid vs plain SQL, per query) references/lexical-vs-vector-vs-hybrid.md
Add real BM25 when ts_rank's missing IDF/length-saturation fails evals references/bm25-when-ts_rank-isnt-enough.md
Add a learned-sparse/SPLADE leg when dense misses rare-term precision and tsvector is too brittle references/learned-sparse-splade-leg.md
Ship a local/notebook/single-binary brain (no server) references/embedded-local-brain.md
Tune the lexical layer (tsvector weighting, exact tokens, multilingual, debug) references/postgres-fts-tuning.md
Turn a dev-context compiled hub or repo artifact set into a vector brain references/dev-context-hub-vector-recipe.md
Scale past ~10M vectors (HNSW tuning, DiskANN, quantization, sharding, graph-augmented retrieval) references/graph-theory-at-scale.md
Cut vector RAM/latency at the default tier (quantize + rescore) references/quantization-and-rescore.md
Run the embedder yourself (cost/residency bars a hosted API) references/embedding-runtime.md
Know what v1 doesn't ship and when to add it references/deferred-extensions.md
Ship to production (backups, RLS, observability, migration drills) references/production-runbook.md
Handle model drift and corpus drift without full re-embedding references/embedding-drift-mitigation.md
Validate inventory scripts/check_brain_manifest.py
Embed and load a corpus scripts/embed_and_load.py
Query the brain from the CLI scripts/retrieve.py

Read the full file on GitHub · 248 lines

Files

What ships with it

54 files beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 12d ago First seen · 248 lines · 40 tokens per session scan A a243df011bf4

Subscribe to this mod's changes

ai-vector-brain is a skill published in the GitHub repository vasilyu1983/AI-Agents-public (87 stars, last pushed 10d ago), licensed MIT. It adds 40 tokens to every session and 5,453 once invoked, about $0.0002 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.