Grounding + Reasoning ยท Cross-LLM Skill

Give your agent a perfect memory.

PocketRAG fuses NotebookLM-grade grounding with your agent's reasoning power. Claude Code, Cursor & Gemini get 100% accurate facts on-demand โ€” then write the code, run the commands, and ship the work.

0
Hallucinated facts
โˆž
Reasoning over docs
<90s
Time-to-RAG
claude-code ยท ~/project
You
Read the API spec PDF I staged, then write a Python server that implements it.
๐Ÿชถ
grounding layer ยท ask_notebook
Retrieved spec: POST /orders, GET /orders/{id}, auth = Bearer. (zero hallucination, OCR-verified)
๐Ÿง 
reasoning layer ยท claude code
Wrote server.py + routes/orders.py implementing both endpoints with Bearer auth. โœ…
The Core Insight

Two layers. One superpower.

PocketRAG doesn't replace your agent's intelligence โ€” it feeds it. A grounding layer guarantees the facts; your reasoning layer does the work.

Layer 1

The Grounding Layer

NotebookLM ยท Discovery Engine API

When your agent calls ask_notebook, the RAG backend does the heavy lifting:

  • High-fidelity retrieval & OCR (even scanned PDFs)
  • Extracts the raw, verifiable facts
  • Returns a strictly grounded, hallucination-free result
  • Documents never bloat the agent's context window
Layer 2

The Reasoning Layer

Claude Code ยท Cursor ยท Gemini

Your agent receives those grounded facts and reasons over them to do real work:

  • Code generation โ€” implement a spec it just retrieved
  • Refactor & debug against documented rules
  • Multi-step workflows โ€” query, test, run, write
  • Edits local files & runs terminal commands
Grounded facts Reasoned action
The "Aha!" Synergy

A software architect with a perfect memory.

Your agent never guesses or forgets the specs โ€” because an instant, managed RAG backend feeds it 100% accurate facts on demand. It keeps every ounce of its reasoning, coding, and execution power, but loses its only weakness: hallucination.

Division of Labor

Each layer plays to its strength.

Dimension Grounding Layer Reasoning Layer
ResponsibilityRetrieval & fact accuracyReasoning & execution
Strength100% accurate search, excellent OCR, zero hallucinationsWrites code, runs commands, understands local workspace
Weakness (alone)Can't edit files / run codeHallucinates when context is stuffed
Powered byDiscovery Engine APIClaude / Cursor / Gemini
Combined result An agent that never forgets the spec โ€” and always ships working code.
The Problem

Smart agents, unreliable memory.

Reasoning models are brilliant โ€” until you stuff a 60-page PDF into their context and they start inventing details.

Agent Alone

  • Hallucinates facts from large documents
  • Loses details when the context window fills up
  • No managed retrieval โ€” you build the RAG yourself
  • Re-uploads the same docs every session

Agent + PocketRAG

  • Grounded, OCR-verified facts on demand
  • Docs live in the RAG, not the context window
  • Zero-infra managed RAG via your GCP project
  • Reuse staged notebooks across sessions
Capabilities

Built for reasoning agents.

One Tool: ask_notebook

Your agent calls it like any other tool. Grounded facts come back as the tool result โ€” ready to reason over, refactor, or implement.

# Claude Code calls the grounding layer
tool: ask_notebook(
  notebook="api-spec",
  query="list all endpoints + auth"
)
# โ†’ grounded, hallucination-free result
# โ†’ Claude then writes server.py itself

Smart Ingestion

Inline for small files, automatic GCS fallback for large ones. You never think about it.

Reuse or Start Fresh

Notebook registry persists in session memory โ€” pick up exactly where you left off.

Per-User OAuth 2.0

Your identity, your project. Documents stay inside your own Google Cloud.

Cross-LLM Skill

One OpenAPI spec โ†’ a Claude Skill, GPT Action, or Gemini Extension.

The Flow

From staged doc to shipped code.

1

Stage

Upload PDFs into a notebook

2

Ground

RAG returns verified facts

3

Reason

Agent plans across facts + workspace

4

Act

Writes files, runs commands

5

Ship

Working, spec-accurate output

Targets

POC success, measured.

โ‰ฅ90%
Grounding accuracy
<90s
Upload โ†’ first answer
100%
Reuse-flow correctness
3
Agent clients supported
System Design

Two layers, backend-less.

architecture.txt
โ”Œโ”€ REASONING LAYER ยท Claude Code / Cursor / Gemini โ”€โ” โ”‚ Reads workspace ยท writes files ยท runs commands โ”‚ โ”‚ calls tool โ–ถ ask_notebook(query) โ”‚ โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜ โ”‚ grounded facts โ–ฒ / query โ–ผ โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ–ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ” โ”‚ GROUNDING LAYER ยท Google Cloud (your project) โ”‚ โ”‚ โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ” โ”‚ โ”‚ โ”‚ Vertex AI Discovery Engine API โ”‚ โ”‚ โ”‚ โ”‚ OCR ยท retrieve ยท ground ยท zero hallucination โ”‚ โ”‚ โ”‚ โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜ โ”‚ โ”‚ โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ” โ”‚ โ”‚ โ”‚ Cloud Storage (large-file fallback) โ”‚ โ”‚ โ”‚ โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜ โ”‚ โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
Interactive

Watch both layers work together.

Pick a task. See the grounding layer fetch verified facts, then the reasoning layer turn them into real output.

Implement the API spec

"Read the API spec PDF and write a Python server that implements it."

Find bottleneck risks

"Read this architecture doc โ€” does my local DB setup have bottleneck risks?"

Multi-step rollback

"Use the runbook to build and dry-run a rollback script."

Generate data models

"Build SQLAlchemy models from the schema PDF."
๐Ÿชถ pocketrag ยท two-layer simulator idle

Select a task on the left, then hit Run Task. Watch the grounding layer fetch facts โ†’ the reasoning layer ship the work.

Give your agent a perfect memory.

Install PocketRAG as a skill, connect your Google Cloud project, and let your favorite LLM reason over 100% accurate facts and persistent memory.