Register and share your invite link to earn from video plays and referrals.

Search results for idem
idem community
One keyword maps to one global community path.
Create community
People
Not Found
Tweets including idem
NOVAK DJOKOVIC HAS ARRIVED IN PARISSSS !!!!! Idemo 🐐
# Neo4j Features and Practical Usage ♻️ "Create it if missing, update it if present." Idempotent writes that never produce duplicate nodes—no matter how many times you replay an event stream—come down to a single `MERGE`. 🏷️ Title: CREATE / MERGE / SET / DELETE 🔗 URL: 📘 Overview `MERGE` is an upsert clause: it matches and binds an existing pattern, or creates and binds it if absent. It fuses `MATCH` and `CREATE` so you can branch on whether the data existed beforehand. It is essential for making daily batches and stream ingestion idempotent. ⚙️ How It Works ・All-or-nothing: `MERGE` operates on the whole pattern—either everything matches or everything is created. It never partially reuses an existing pattern. To mix matching and creating, decompose into multiple `MERGE` clauses. ・`ON CREATE SET` / `ON MATCH SET`: property assignments that run only on create or only on match—handy for creation timestamps or access counters. Both can coexist. ・Merging relationships: at least one endpoint node must already be bound. An undirected `-[r:KNOWS]-` is tried both ways before creating left-to-right. ・Constraints: a uniqueness constraint gives `MERGE` conflict detection and prevents duplicates. For performance, creating an index on the label/property is strongly recommended (without it, every merge scans all nodes). 🛠️ Practical Usage Idempotent upsert over an event stream: ```cypher MERGE (u:User {id: row.userId}) MERGE (p:Page {url: row.url}) MERGE (u)-[v:VIEWED]->(p) ON CREATE SET v.count = 1 ON MATCH SET v.count = v.count + 1 ``` A standard pattern for creating derived nodes without duplicates: ```cypher MATCH (person:Person) MERGE (loc:Location {name: person.bornIn}) MERGE (person)-[r:BORN_IN]->(loc) ON CREATE SET r.createdAt = timestamp() ``` 💡 Use Cases ・Ingesting clickstream/IoT events, deduplicating the same user and page while accumulating counts. ・An ingestion layer where multiple pipelines write master data without ever doubling up entities. ⚠️ Caveats ・Always pair `MERGE` keys with a uniqueness constraint. Without one, concurrent runs can briefly create duplicates (constraints guarantee only eventual consistency). ・`MERGE` rejects `null` property values. Do conditional assignment with a later `SET`. ・You cannot cross-reference a node being created within the same `MERGE`. Match it first, or split into a `SET`. ・`DELETE` fails on a node that still has relationships; use `DETACH DELETE`. #Neo4j# #Cypher#
Show more
🚨 WOW! The company that NJ Gov. Mikie Sherrill blamed for 6,600 noncitizens being registered to vote just accused the STATE Division of Elections of registering those foreigners — NOT the firm who transmits the information SHE LIED!! “Information submitted by IDEMIA must still be validated and adjudicated by the Division of Elections.” They saw “NONCITIZEN” in the data yet registered them anyway…NO “GLITCH” in the software. Every state must be fully audited now and the people responsible should face swift legal consequences!
Show more
0
171
3K
1.2K
Forward to community
TL;DR A single Python SDK that lets you swap between DeepAgents, Pydantic AI, Claude Agent SDK, Codex, and OpenCode without rewriting your application code — built around the same query() interface as the Claude Agent SDK. Title: LiteAgents (BerriAI/liteagents) URL: Points 🔀 Switch agent harnesses just by changing the harness parameter 🌐 Supports 8+ model providers via LiteLLM, including OpenAI, Anthropic, Gemini, and Groq 🛠️ Pass typed Python functions and they auto-adapt to each harness's tool schema 💬 LiteAgentClient keeps persistent conversation history across multiple query() calls ⏱️ Optional Temporal integration adds crash recovery, replay, and idempotent tool execution ⚙️ Profiles can be defined in Python, YAML, or JSON 📡 Full async/await and streaming support This could be the end of rewriting your agent code every time you switch harnesses. #AIAgents# #OpenSource#
Show more
# Practical and Useful Patterns with ADK ## 🎨 Battle-Tested Callback Patterns for Production ADK Agents You know how callbacks work — but how do you actually use them in production? Master ADK's **Callback Design Patterns** for logging, caching, security, and more! 💪 ## 📌 Title Callback Patterns (Design Patterns and Best Practices) ## 🔗 URL ## 🧩 Overview ADK callbacks have well-established patterns that recur in production systems: logging, caching, state management, security guardrails, request/response modification, conditional skipping, and artifact handling. The documentation also defines best practices — single responsibility, performance awareness, idempotency, and error handling — to keep callbacks robust. A critical guideline: **for cross-agent security guardrails, prefer Plugins over Callbacks**. ## 🛠 How to Use **Pattern 1: Logging & Monitoring** `logging_before_tool(ctx, tool, args)` logs the `ctx.invocation_id`, ` and `args` via ` then returns `None` to observe without altering the flow. `logging_after_model(ctx, response)` logs the length of ` with the invocation ID, and likewise returns `None`. **Pattern 2: Caching Strategy** `cache_before_tool(ctx, tool, args)` builds a cache key from ` and `hash(str(args))`, then checks `ctx.state.get(cache_key)`. On a cache hit, it returns the cached value to skip tool execution. On a miss, it returns `None` to proceed. `cache_after_tool(ctx, tool, args, tool_ctx, result)` stores the result in `ctx.state[cache_key]` using the same key, then returns `None` to continue without modification. **Pattern 3: State Management** `state_aware_callback(ctx, req)` retrieves the user tier from `ctx.state.get("user:tier", "free")`, and if the tier is `"premium"`, appends additional instructions to `req.config.system_instruction`. It returns `None` to continue the normal flow. ## 🏗 Practical Usage **Multi-layer defense pattern for production:** As a security guardrail (Plugins are preferred for cross-agent use), `security_before_model(ctx, req)` extracts user input from `req.contents[-1].parts[0].text`, runs `detect_pii()` to check for personal information, and if found, calls `audit_log()` and returns an `LlmResponse` with a rejection message to skip the LLM call. It also runs `detect_injection()` for prompt injection detection, blocking with a similar `LlmResponse` if detected. If neither check triggers, it returns `None` to continue. For tool argument sanitization, `sanitize_before_tool(ctx, tool, args)` checks if ` is `"database_query"` and whether `args.get("query", "")` contains `"DROP"`, returning an error dictionary to block dangerous queries. For artifact persistence, `save_artifact_after_agent(ctx)` calls `generate_report(ctx)` and saves the result via `"execution_report.json", report)`, returning `None`. ## 💡 Use Cases - 📊 **Structured logging**: Emit structured logs with invocation IDs at every execution point - 💾 **API cost reduction**: Cache tool results with before/after patterns to avoid redundant calls - 🔐 **Layered security**: Place PII detection, injection prevention, and SQL sanitization at different layers - 📦 **Artifact management**: Auto-save execution results and reports as artifacts - 🎚️ **Dynamic behavior**: Adjust instructions dynamically based on user tier or session state ## ⚠️ Caveats - **Single responsibility**: Give each callback one purpose — don't mix logging with validation - **Performance**: Callbacks execute synchronously; avoid blocking I/O or heavy computation - **Idempotency**: Design callbacks with external side effects to be safe when retried - **Error handling**: Always wrap in try-except to prevent callback errors from crashing the process - **Prefer Plugins**: For cross-agent security policies, consider **Plugins** over per-agent callbacks ## ✨ Closing Knowing callback patterns dramatically levels up your ADK skills. Combine logging, caching, security, and state management patterns to build robust, cost-efficient agents. And for cross-cutting security concerns, don't forget Plugins! #ADK# #AIAgent#
Show more
Chinese researchers did it again! OpenBMB just open-sourced MiniCPM5-2B, a dense 2B-parameter model built for reasoning, coding, and tool use on resource-constrained hardware. Artificial Analysis ranked it highest among models under 4B in its Agentic Index comparison. It scored 20, while Granite 4.2 8B scored 9. The model is particularly strong at coding and tool calling, so I tested both capabilities locally. I pulled it onto my machine, connected it to a constrained CI repair agent, and gave it one issue: > A customer reports that retrying checkout with the same idempotency key returns a larger total. The first request returns $109, while the retry returns $118. Find the root cause, fix it without changing the public API contract, and verify the complete test suite. The Python checkout service had 18 tests. Sixteen passed, while two failed on the retry path. The agent could list files, search code, read selected ranges, run approved tests, apply a patch, and inspect its diff. It reproduced the failure, then followed the checkout and idempotency paths through the repository. The model found that shipping was added to mutable order state before the cached result was checked. On retry, the same order already contained shipping, so the calculation added it again. It generated a narrow patch that moved the idempotency check ahead of the mutation without changing the public API. The agent ran the targeted tests and the complete suite. All 18 tests passed. The model was never told which file contained the issue or what change to make. Each test result, search result, and code inspection determined its next action. The video below shows the full trajectory, including the investigation, tool calls, generated patch, diff, and final verification. Everything ran 100% locally on my machine throughout the run. MiniCPM5-2B supports llama.cpp, Ollama, vLLM, SGLang, iOS, Android, and HarmonyOS for local deployment. The model weights, training recipes, reasoning datasets, and UltraX data-refinement system are open-source. GitHub Repo: A 2B model can now inspect a repository, reason across multiple files, modify code, and verify its patch while remaining small enough to target local hardware.
Show more
Practices for embedding AI agents into enterprise systems [Circuit Breaker + Model Fallback] 💡 LLM providers go down. Are you designing for that reality? Circuit breakers and fallback models structurally eliminate single points of failure. 🔥 Problems solved - LLM provider outages or maintenance cause complete agent downtime - Retry storms against a failing provider compound system-wide load - Single-provider dependency becomes an availability risk for all agents 🏗️ Proposed pattern When the primary model's error rate or latency exceeds thresholds, automatically switch to a secondary model on a different provider or region. If the secondary is also unavailable, return degraded responses from cache or a "currently unavailable" message. The circuit breaker (Open/Half-Open/Closed states) prevents request floods during outages. After recovery, traffic gradually shifts back to the primary through a Half-Open state. Embed this logic in the AI gateway to avoid duplicating it across individual applications. ✅ Selection criteria - Use when: All production environments (LLM availability variance is a given) - Skip when: No exceptions -- apply by default for production workloads ⚠️ Pitfalls - Overly generous timeouts cause user abandonment and resource exhaustion - Retrying side-effecting operations without idempotency keys risks duplicate execution - Failing to eval the fallback model beforehand means quality drops go unnoticed after switchover 🛠️ Implementation Approach 1. Introduce a multi-provider abstraction layer (LiteLLM / Portkey) to decouple primary/secondary model switching from application code 2. Embed a circuit breaker (resilience4j / Polly) in the AI gateway with error rate and latency thresholds (start at 2-3x P99) for automatic Open/Half-Open/Closed state transitions 3. Pre-validate fallback model quality against eval datasets and confirm acceptable performance before registering as a fallback target 4. Attach idempotency keys to side-effecting operations to prevent duplicate execution on retries 5. Set up health check endpoints and use Half-Open state to gradually shift traffic back to the primary after recovery is detected #AIAgents# #EnterpriseArchitecture#
Show more
spent yesterday hardening `outpost`'s outbound calls: strict deadlines + smart retries for every external fetch. most calls had no timeout. five were blocking DB operations. a hung X publish could strand a post indefinitely. now, every request needs `timeoutMs`. retries are opt-in & idempotent only. a 500 at publish-time means "MAY be live, check before retrying" to prevent double-posts. the boring plumbing that prevents catastrophic outages.
Show more
𝕏 is officially giving agents their own identity on the platform... with permissions, ownership and native infrastructure built for the agent era Each bot gets its own real identity on 𝕏: It gets: • Its own @handle • Its own display name • Its own user ID • Its own identity on X But there is no password and no normal login The bot itself acts through its API bearer token And X makes ownership transparent: Every bot carries an “Automated by @owner ” label pointing back to the X account that owns the developer app The entire lifecycle can be managed through the API: • Create a bot • List all bots in your project • Change its @handle or display name • Control who can DM it • Rotate its access token • Instantly revoke access • Permanently delete the bot You can even choose whether DMs are open to: • Everyone • Premium users • Nobody The bot token can access things like: • Reading DMs • Sending DMs • Reading posts • Reading users • Uploading media And the security model is actually pretty serious The bot token is shown ONCE when it is created You can never retrieve that token again If you rotate it, the previous token is automatically killed And there is a separate revoke endpoint that acts basically like an emergency kill switch without deleting the bot itself Another really nice detail: Bot creation is idempotent If your request fails and you retry creating the same @handle, X returns the existing bot and safely issues a fresh token instead of accidentally creating duplicates Bots are also isolated to the developer project that created them.....one app cannot just manage another app’s bots The default allowance is currently 1 bot per project, with the maximum depending on your plan This is basically 𝕏 building native infrastructure for an entire ecosystem of agents: • Support agents • Research bots • Business assistants • Community bots • AI personalities • Automated services • And eventually much more These aren’t bots pretending to be humans They are native bot accounts with their own identity, permissions, security and explicit ownership This is going to be the foundation for an entire agent economy inside 𝕏
Show more
🚀 An ebook that takes FastAPI from your first endpoint all the way to production-scale AI systems — going deep on LLM/RAG serving, with interview questions at the end of every chapter. Title: FastAPI for AI Engineers: From First Endpoint to Production-Scale AI Systems URL: 🚀 Overview A practical guide (First Edition, 2026, by AI Engineering Insider) for AI engineers serving ML models and LLM/RAG systems in production with Python. It spans 10 chapters and 100 interview questions, woven with real-incident case studies and cost-model sidebars. ❓ Challenges Solved ・Building a model is one skill; serving it safely as a scalable production API is another ・LLM/RAG serving has its own hard parts — streaming, guardrails, cost control The book reframes FastAPI as "the de facto serving layer for AI and ML systems." 💡 Structure & Tech Covered ・Foundations: ASGI/WSGI, Uvicorn, OpenAPI, and Pydantic v2 schema separation and validation ・Implementation: idempotency, meaningful status codes, pagination, and the Router→Service→Repository clean architecture ・DB/Security: SQLAlchemy/SQLModel/Alembic, N+1, pool sizing, JWT, BOLA defense, OWASP API Top 10 ・Async: "never block the event loop," def vs async def, and httpx retries/circuit breakers 🎯 The Core (Ch.9: AI/RAG/LLM) ・Load model weights once in lifespan; offload CPU inference to a thread ・An LLM gateway centralizing auth, prompts, guardrails, and cost metering, with SSE token streaming ・Build RAG with embeddings + a vector DB (start with pgvector); validate output with Pydantic, then retry on failure ・Enforce max_tokens as a "spending limit" via the type system 📊 Highlights ・Practice-first, learning from real incidents (Netflix, Stripe, GitLab, Optus, Air Canada) ・Ch.10 covers Gunicorn+Uvicorn, K8s liveness/readiness, the three pillars of observability (p99 vs p50), and SLO-based alerting #FastAPI# #AIEngineering#
Show more