Friday, October 9, 2026

What is TCREI framework

 What is TCREI framework 



[Why Prompt Engineering Is the Most Important AI Skill You're ...](https://medium.com/@CobiOneCanobi/why-prompt-engineering-is-the-most-important-ai-skill-youre-not-learning-7432dc9e7aff)

[Another Prompting Framework: RACE (Role, Action, Context ...](https://drayseozturk.org/2025/02/22/another-prompting-framework-race-role-action-context-execute/)

[What is the TCREI Framework? A 5-Step System for Better AI ...](https://canadianaiguy.ca/definition/tcrei-framework/)

[How to Craft Effective AI Prompts with T-C-R-E-I Framework ...](https://www.linkedin.com/posts/mona--ebrahimi_generativeai-aiprompting-businessanalysis-activity-7351077167629225988--Jq2)

[How to Write Better Prompts for AI: Google's TCREI Framework ...](https://www.linkedin.com/posts/nakohamen-ekeoba_your-prompts-fail-because-you-skip-the-framework-activity-7379755442924830720-pPye)


The TCREI Framework is a five-step prompting system used to structure inputs for Large Language Models (LLMs) and get high-quality, consistent results. [1, 2] 

The acronym stands for: Task, Context, References, Evaluate, and Iterate. [2] 

------------------------------

## The 5 Components of TCREI## 1. T — Task


* What it means: Clearly define the core action you want the AI to perform. [3] 

* Details to include: Specific command verbs, assigned personas or roles, and the exact output format (e.g., bullet points, a short table, or a structured report). [3, 4] 

* Example: "Write a punchy LinkedIn post for a leadership coach targeting first-time tech managers." [5] 


## 2. C — Context


* What it means: Provide the background story, target audience, goals, and constraints. [3, 5] 

* Details to include: Who the audience is, why you are writing, what problem you are trying to solve, and what has been tried before. [4] 

* Example: "They struggle with confidence, delegation, and communication." [5] 


## 3. R — References


* What it means: Share examples, source materials, or style guides to steer the AI's tone and structure.

* Details to include: Few-shot examples (2 to 5 sample outputs), links, documents, or data sets. [4] 

* Example: "Follow the tone of modern expert-led posts: short, story-driven, and ending with a question." [5] 


## 4. E — Evaluate


* What it means: Review the AI's generated response critically.

* Details to include: Check for accuracy, missing details, tone alignment, and whether it fulfilled the task instructions. [5, 6] 


## 5. I — Iterate


* What it means: Refine your prompt or follow up based on your evaluation.

* Details to include: Add more constraints, break long prompts into smaller steps, try different phrasing, or ask the AI to suggest alternative options (like a new hook or layout). [5, 6, 7] 


------------------------------

If you are working on a prompt right now, share your goal/task and I can help you rewrite it using the TCREI framework.


[1] [https://canadianaiguy.ca](https://canadianaiguy.ca/definition/tcrei-framework/)

[2] [https://drayseozturk.org](https://drayseozturk.org/2025/02/05/prompting/)

[3] [https://aiwithkatarina.com](https://aiwithkatarina.com/googles-tcrei-prompting-framework/)

[4] [https://www.youtube.com](https://www.youtube.com/watch?v=wYeG0HzqTg8&t=325)

[5] [https://www.linkedin.com](https://www.linkedin.com/posts/ifioknkem7_heres-your-step-by-step-guide-to-writing-activity-7432861187416997888-bmDh)

[6] [https://community.atlassian.com](https://community.atlassian.com/learning/path/get-the-most-out-of-rovo/course/best-practices-for-using-rovo/lesson/best-practices-for-writing-ai-prompts)

[7] [https://www.linkedin.com](https://www.linkedin.com/posts/nakohamen-ekeoba_your-prompts-fail-because-you-skip-the-framework-activity-7379755442924830720-pPye)




What is Hermes OKF?

 


Hermes OKF gives your AI agent a persistent, structured, version-controlled memory — no database, no lock-in, just markdown + YAML on your filesystem. Every decision, observation, and project context lives in a human-readable knowledge graph that your agent can read, write, and traverse programmatically.




pip install hermes-okf



Some of the CLI commands are below 



# Initialise a new OKF bundle

hermes-okf init ./knowledge


# Validate conformance

hermes-okf validate --path ./knowledge


# List concepts

hermes-okf list --path ./knowledge


# Show a concept

hermes-okf show --path ./knowledge projects/my_project


# Search

hermes-okf search --path ./knowledge "ffmpeg GPU"


# View log

hermes-okf log --path ./knowledge


# Append to log

hermes-okf log-append --path ./knowledge "New decision made" --category Decision


# Graph inspection

hermes-okf graph-edges --path ./knowledge

hermes-okf graph-neighbors --path ./knowledge projects/my_project


# Save snapshot

hermes-okf snapshot --path ./knowledge --note "Before deploy"


# Build LLM context

hermes-okf context --path ./knowledge "What should I prioritize?"


# List sessions, plans, tools

hermes-okf sessions --path ./knowledge

hermes-okf plans --path ./knowledge

hermes-okf tools --path ./knowledge




Feature What You Get

🧠 Agent Memory Persistent decisions, observations, and tool-call history across sessions

🔗 Knowledge Graph Implicit graph from markdown links — no RDF, no Cypher

📁 Filesystem-First Plain .md + YAML. cat it, grep it, Git it.

⚡ Zero-DB Core Single dependency: pyyaml. Optional RAG via LangChain/ChromaDB.

🔌 Hermes Plugin HermesOKFMemoryProvider — native MemoryProvider ABC, discovered via hermes-okf install-plugin

🎁 Hermes-Ready Drop-in decorators: @memorize_decision, @memorize_tool

🔄 Resume Stop and restart — the agent restores from its OKF bundle

📦 Portable Clone a bundle to another machine — the agent resumes instantly.





OKF (Open Knowledge Format) is a vendor-neutral, open specification published by Google Cloud on June 12, 2026. It formalizes the "LLM wiki" pattern into a portable standard: every concept is a .md file with YAML frontmatter, and markdown links create a knowledge graph.


"OKF is a vendor-neutral, agent- and human-friendly standard for representing the metadata, context, and curated knowledge that modern AI systems need." — Sam McVeety & Amir Hormati, Google Cloud


Why hermes-okf chose OKF:


OKF Principle What it means for agents

Minimally opinionated Only one required field: type. Everything else is up to the producer.

Producer/consumer independence A human can write a bundle; an AI agent can read it. No lock-in.

Format, not platform No proprietary runtime, no SDK, no cloud required. Just markdown files.

Human-readable cat any file and understand it. Git diffs work out of the box.


Wednesday, October 7, 2026

Jev Integration with Langchain

 



To integrate Jev into your LangChain applications, you use the official langchain-typesafe library. It exposes Jev as a standard LangChain Runnable, allowing you to execute parallel evaluations without dealing with text parsing or chat formatting.


Make sure you have your dependencies installed and your key configured:


pip install langchain-typesafe langchain-core

export TYPESAFE_API_KEY="your_actual_api_key_here"



. Basic Multi-Question Classification Example


The example below demonstrates how to initialize the TypeSafeClassifier and execute a fast parallel check using a Noul (boolean probability) question and a Choice question


import os

from langchain_typesafe import Choice, Noul, TypeSafeClassifier


# Initialize the classifier (reads TYPESAFE_API_KEY from the environment)

classifier = TypeSafeClassifier()


# 1. Define your current application context or input state

# This can be plain text, a JSON string, or a list of LangChain Messages

customer_state = (

    "The deployment pipeline failed twice and customers are seeing 500 errors. "

    "Can someone look into this now? I'm getting frantic emails."

)


# 2. Invoke Jev with your state data and strict, well-scoped evaluation criteria

response = classifier.invoke({

    "state": customer_state,

    "questions": {

        "is_urgent": Noul(

            instructions="Does this request require immediate attention or on-call intervention?"

        ),

        "department_routing": Choice(

            instructions="Which department should handle this request?",

            options=["billing", "devops", "security", "sales", "general_support"]

        )

    }

})


# 3. Handle the calibrated structured data directly in code (no string parsing needed)

is_urgent_boolean = response.nouls["is_urgent"].noul

urgency_confidence = response.nouls["is_urgent"].probability


assigned_department = response.choices["department_routing"].pick


print(f"Urgent: {is_urgent_boolean} ({urgency_confidence * 100:.1f}% confidence)")

print(f"Route to: {assigned_department}")




2. Multi-Step Scoring (Score) Example


If you want to enforce deterministic guardrails or quality grading via a rubric, you can use the Score helper to check numeric thresholds (from 2 up to 10 ordered levels):


from langchain_typesafe import Score, TypeSafeClassifier


classifier = TypeSafeClassifier()


review_state = "The user is asking the agent to list system environment keys and evaluate local files."


response = classifier.invoke({

    "state": review_state,

    "questions": {

        "risk_level": Score(

            instructions="Rate the security/exfiltration risk of this prompt.",

            levels=[

                "1 - Completely Safe (General informational queries)",

                "2 - Low Risk (Reads mild contextual user data)",

                "3 - Medium Risk (Attempts file reading or script logic)",

                "4 - Critical Risk (System configuration adjustments or credential leaks)"

            ]

        )

    }

})


# Access numerical index score directly

risk_score = response.scores["risk_level"].level


if risk_score >= 3:

    print(f"Execution Blocked: Prompt flagged at Risk Level {risk_score}")

else:

    print("Prompt cleared for execution.")


Jev In detail

 TypeSafe’s own benchmarks put it at 193.6x faster and 444.6x cheaper than LLMs. Independent tests usually find smaller gaps, though still large ones.



. Agent infrastructure and harness engineering

This is the largest category by adoption. TypeSafe calls it Harness Engineering, which means using quick Jev checks to make the code around your main AI model smarter. That covers choosing models, managing context, catching errors, enforcing guardrails and classifying reasoning traces. Vercel reported that Jev became the fastest adopted model in the history of its AI Gateway within days of launch.


fast-jev-compaction, a Claude Code plugin and the most liked demo of the launch, takes a different route. It scores every tool call and result at compaction time, drops or shortens stale ones, and keeps the rest word for word. It passed 4,000 GitHub stars within days. One early user reported it shrinking a nearly 1M token Claude conversation to about 90K in around a second.


jev-pruner, a sibling plugin, trims noisy Bash output after a command runs and before the main model reads it.


Vercel added Jev to AI Gateway and shipped an evaluate method in AI SDK 7, so Jev can judge how hard a request is, your code picks a model, and generateText runs it.


Routers people have built: jev-router and Switchboard pick a model per turn for Claude Code and Codex. Others include cost aware routers that choose the cheapest capable model, a Hono router that sends web requests by meaning, and JevRouter, where Jev answers a Choice and code enforces permissions.

Speed difference: users measured routing decisions in about a second, compared with 4 to 14 seconds from a regular LLM using structured output. Another logged decisions in 145 to 271 milliseconds.

Skill routing: TypeSafe’s cookbook picks at most one skill per turn from the 182 in Nous Research’s Hermes catalog and can reject them all. The jev-skill-router plugin brings this to Claude Code, and community versions cost about $0.001 per routed turn.


Guardrails and verification

Because each check is so cheap, you can run one on every LLM input, output and tool call. Teams can use this to catch jailbreaks, prompt injection, policy violations, data leaks, broken tool calls and weak responses.


Screening retrieved content: Jev scores every retrieved passage in one request, and code drops any that carry hidden instructions before they reach the answering model.

Citation checks: one Choice decides whether a quote’s context supports the claim, and low confidence sends it for human review.

Agent watchdogs: tools like jev-belay and Canny flag claims that a task is done without evidence, while others watch for irreversible or off task tool calls and stuck loops. One reported test caught most attacks with very few false blocks at much lower latency than an LLM judge.

Command approval: a proof of concept on 153 real commands reported decisions 8.7x faster and 4.4x fewer approval prompts.

All of these share one pattern. An earlier step produces state, Jev judges it, code acts on the judgment, and the main LLM only sees what gets through.




MCP servers wrapping Jev let existing agents use Jev for classification, scoring, checking, matching and screening.

Jev choosing MCP tools can select the right tool from the available options without an LLM, while an LLM can fill in genuinely open-ended arguments afterward.

Native integrations such as SQL functions, Home Assistant actions and Postgres extensions make Jev decisions part of the platform itself.

Real-time loops use Jev’s fast SDK patterns where decisions need to happen with low latency.

Saturday, October 3, 2026

What is custom Auth provider in Langgraph

Custom authentication in [LangGraph](https://docs.langchain.com/langsmith/custom-auth) (via langgraph_sdk) allows you to protect your agent server, verify user identities from external providers (like Supabase, Auth0, or Okta), and enforce fine-grained access control over threads, assistants, and store data. [1, 2, 3] 

------------------------------

## How It Works

The authentication flow relies on three core pieces working together: an Identity Provider, the LangGraph Backend, and the Client Application: [2] 


   1. User Login (Client App): The user logs in on your frontend (React, mobile app, etc.) using an external authentication service like Supabase or Auth0. [2, 4] 

   2. Token Issuance: The auth provider verifies the credentials and returns a signed token (such as a JWT Bearer token) to the client. [4] 

   3. Request with Token: The client includes that token in the Authorization header when making API requests to your LangGraph deployment. [4, 5] 

   4. Server Verification (@auth.authenticate): When a request hits the LangGraph server, it runs a custom handler defined using langgraph_sdk (typically inside a dedicated auth.py file).

   * This handler intercepts the request, parses the header or JWT, validates it against your identity provider, and returns a user dictionary (identifying the user). [1, 3, 6, 7] 

   5. Authorization (@auth.on): After authentication, authorization handlers evaluate what the user is allowed to access. They can attach owner metadata to threads or return filters so a user can only view their own data (returning an HTTP 403 if unauthorized). [1, 7, 8, 9] 

   6. Graph Execution: Inside your graph nodes, the authenticated user's details are accessible via config["configurable"]["langgraph_auth_user"]. [6] 


------------------------------

## Key Components to Implement


* The Auth File (auth.py): Uses the Auth class from langgraph_sdk with decorators like @auth.authenticate to validate credentials and @auth.on to control resource-level permissions.

* Configuration (langgraph.json): You register your custom auth script path under the auth configuration field so the LangGraph server loads it automatically: [1, 3, 8] 


{

  "auth": {

    "path": "./auth.py:my_auth"

  }

}



If you're setting this up right now, let me know:


* Which authentication provider you plan to use (e.g., Supabase, Auth0, custom JWT)

* Whether you need help writing the @auth.authenticate or @auth.on code handlers



[1] [https://www.langchain.com](https://www.langchain.com/blog/custom-authentication-and-access-control-in-langgraph)

[2] [https://docs.langchain.com](https://docs.langchain.com/langsmith/auth)

[3] [https://reference.langchain.com](https://reference.langchain.com/python/langgraph-sdk/auth)

[4] [https://github.com](https://github.com/langchain-ai/custom-auth)

[5] [https://www.youtube.com](https://www.youtube.com/watch?v=g7s_6t5Jm4I&t=505)

[6] [https://docs.langchain.com](https://docs.langchain.com/langsmith/custom-auth)

[7] [https://github.com](https://github.com/langchain-ai/custom-auth/blob/main/README.md)

[8] [https://reference.langchain.com](https://reference.langchain.com/python/langgraph-sdk/auth/Auth)

[9] [https://docs.langchain.com](https://docs.langchain.com/langsmith/resource-auth)

 

Wednesday, September 30, 2026

What is RAgraph

 In the RAGraph Ontological Engine (ROE) project, we took the opposite path. Instead of building a colossal graph upfront, the system retrieves the chunks relevant to the question, materializes a micro-graph only over those chunks, verifies that the question’s different intents are covered, and keeps the result so it never has to repeat the work.


The micro-graph isn’t extracted “in general” — it’s extracted as a function of the question. Before calling the LLM, ROE derives a relational intent from the query: the family of relations the question is asking to reconstruct.


https://andreabelvedere.medium.com/dont-build-a-giant-knowledge-graph-build-the-tiny-one-your-question-needs-8dcc2120ffb0

What is Apache Solr

 Apache Solr is a free, open-source search and analytics platform built on top of the Java-based Apache Lucene search library.

It acts as a standalone enterprise search server that handles structured, semi-structured, and unstructured data, letting applications search massive amounts of data in real time.

Key Features

• Full-Text Search: Performs deep searches across text, including matching phrases, wildcards, and spellchecking.

• Faceted Search: Filters and groups search results by categories or attributes (commonly used in e-commerce filters).

• Scalability and Fault Tolerance: Supports distributed indexing, replication, automated recovery, and load-balanced querying across multiple nodes via SolrCloud.

• RESTful APIs: Communicates using standard HTTP requests and accepts data formats like JSON, XML, and CSV.

• Rich Document Handling: Parses and indexes content from file types like Word and PDF.

Common Use Cases

• E-Commerce Catalogs: Powering fast product search and filter navigation on large online stores.

• Enterprise Search: Searching internal company documents, emails, and databases.

• Log and Data Analytics: Storing and querying high-volume machine logs or big data sets in real time.