📝 Archived :https://ojitha.blogspot.com.au
Ontology Evals for LLMs
Can a Large Language Model write a pizza recipe that actually makes sense? This post turns formal domain ontologies into evaluation frameworks for LLM outputs, using the canonical Stanford Pizza ontology as the running example. The pipeline parses OWL classes and properties, extracts entities from the generated text into RDF triples, then runs reasoners and SHACL shapes to check class membership, cardinality and forbidden combinations. SPARQL ASK queries flag violations such as meat toppings on a vegetarian pizza, yielding factual coverage, relation correctness and logical coherence scores that go far beyond what surface metrics like BLEU or ROUGE can measure.
LlamaIndex RAG for Science Community
LlamaIndex is a comprehensive data orchestration framework designed to connect large language models with private data sources through Retrieval-Augmented Generation (RAG) architecture. The framework operates through two main stages: indexing, where vector embeddings are created from documents, and querying, where relevant information is retrieved and synthesized. LlamaIndex supports multiple chat engines including condense question, context, and condense-plus-context modes for enhanced conversational AI applications. Quality evaluation is crucial for RAG performance, utilizing metrics like Mean Reciprocal Rank (MRR) and Hit Rate to assess retrieval accuracy. The framework includes faithfulness and relevance evaluators to measure response quality, making it essential for building reliable AI applications that require domain-specific knowledge integration with seamless LLM integration capabilities.
Structured Model for AI
Python type annotations are essential for AI agent development with frameworks like LangGraph and AutoGen, enabling automatic schema generation, runtime validation, and seamless LLM integration. This comprehensive guide explores modern Python typing features, including TypedDict for state management, Pydantic models for data validation, and parameterised generics. It covers practical implementations using Python 3.12+ syntax, structured output with ChatGPT, and real-world examples demonstrating tool registration and function calling. The tutorial shows how type hints evolve from optional documentation to architectural foundations in AI development, providing automatic error handling, JSON schema generation, and reliable data flow between agents, resulting in robust conversational AI systems.
AI Agent testing with LangGraph
How to build, test, and deploy sophisticated AI agents using LangGraph and LangChain. It explains the implementation of graph-based architectures that mirror human reasoning, manage state securely with Python typing, and bind custom tools like weather retrieval and mathematical calculations. The documentation highlights the importance of visual debugging through LangSmith and LangGraph Studio to track decision-making steps and conversation history effectively. Furthermore, it outlines robust testing strategies for validating agent capabilities against diverse queries like calculations and web searches. Finally, the text transitions into production considerations, emphasising scalability, security hardening, asynchronous execution, and observability for enterprise readiness.
Steup LangGraph Studio for AI Agent
Complete LangGraph Studio setup guide for AI agent development featuring visual debugging, real-time execution monitoring, and hot reloading capabilities. Step-by-step tutorial includes working code examples for building production-ready AI agents with tool integration, state management, conditional routing, and seamless LangSmith tracing for optimized multi-step reasoning processes.
✅ Complete UV setup - from installation to project configuration
✅ Working agent example - with tools, state management, and proper routing
✅ Multiple testing methods - Studio UI, Python scripts, and direct API calls