今日已更新 96 条资讯 | 累计 24053 条内容
关于我们

标签:#an

找到 1802 篇相关文章

AI 资讯

How I Built a RAG Chatbot Into My Portfolio with LangGraph, PGVector & MCP

Most portfolios have a boring "About Me" paragraph. I replaced mine with something you can talk to — an AI terminal that answers questions about me, pulls my live GitHub activity, and remembers the conversation. You can try it right now on my portfolio: rehbarkhan.in . I'm Rehbar Khan , a Full Stack & Gen-AI developer, and in this post I'll break down exactly how it works — the RAG pipeline, the LangGraph agent, the memory layer, and how I wired in real GitHub data with MCP. No fluff, just the architecture. The problem I wanted a portfolio assistant that could: Answer questions about my background accurately — no hallucinated jobs or fake projects. Fetch live data (my latest GitHub activity), not a stale snapshot. Remember the conversation across messages. Stream responses token-by-token like a real terminal. That rules out "just prompt an LLM." You need retrieval for grounding, tools for live data, and state for memory. Here's the stack I landed on. Architecture at a glance Next.js 16 chat UI ──► FastAPI (streaming) ──► LangGraph agent ├── RAG retriever → pgvector (Neon Postgres) ├── GitHub MCP tool → live GitHub data └── Redis checkpointer → conversation memory Frontend: Next.js 16 (App Router, TypeScript) — a streaming terminal UI. Backend: FastAPI with streaming responses. Orchestration: LangGraph ( StateGraph , ToolNode , tools_condition ). LLM: OpenAI gpt-4o-mini . Retrieval: text-embedding-3-small → pgvector on Neon Postgres. Memory: Redis checkpointer for per-session history. Live data: GitHub via the Model Context Protocol (MCP) . 1. The RAG pipeline Everything the bot knows about me lives in a single reference.txt . I chunk it, embed it, and store it in Postgres with pgvector: from langchain_text_splitters import RecursiveCharacterTextSplitter from langchain_openai import OpenAIEmbeddings from langchain_postgres import PGVector splitter = RecursiveCharacterTextSplitter ( chunk_size = 500 , chunk_overlap = 80 ) chunks = splitter . split_text ( open ( " refe

2026-07-19 原文 →
AI 资讯

My Solana Program Launch Checklist (Written the Day After I Actually Did It)

Three weeks from now I will open a terminal, ready to ship another program to mainnet-beta, and I will pause. What was the order again? Did the IDL go up before or after the authority transfer? Was there a flag that saved me from a stalled deploy last time? This checklist exists because I just walked the entire path devnet to mainnet, deploy to IDL to frontend to error handling, and I wrote it down while the details are still fresh. It is the document I wish I had on day one of that process. Run it top to bottom before every mainnet launch. Why a checklist at all? A Solana mainnet deploy is full of irreversible steps. The wallet that signs the deploy quietly becomes the program's upgrade authority. A buffer account left mid-deploy can strand real SOL. A plain anchor build after a verifiable build can produce a different hash and break verification later. None of these are complicated. They are all easy to forget under pressure. A checklist is not a crutch; it is the habit that lets you ship calmly instead of improvising each time. Phase 1: Pre-flight on devnet Do all of this while mistakes are still free. [ ] Every test passes against the final build. Run anchor build && cargo test --package <your-program> one last time. The binary you test must be the binary you ship. [ ] End-to-end run on devnet. Call every instruction through the actual frontend, not just the test suite. The frontend is a different caller than LiteSVM and will surface different failure modes. [ ] Produce a verifiable build. Run anchor build --verifiable . This pins the build environment so the on-chain bytecode can later be matched to your source code. Once you have this artifact, do not touch it with a plain anchor build or cargo build-sbf ; those can produce a different hash and silently break verification. [ ] Measure rent before you spend it. Run: solana rent $( wc -c < target/deploy/.so ) Your deploy wallet must hold this amount plus a margin for transaction fees. There is no airdrop on the

2026-07-19 原文 →
开发者

The Hidden Cost of yield in C#: What the Compiler Doesn't Tell You

Most C# developers know how to use yield return. Few understand what actually happens after compilation. If you've ever written something like this: public IEnumerable < int > GetNumbers () { yield return 1 ; yield return 2 ; yield return 3 ; } it looks almost magical. No collection. No list allocation. No iterator implementation. Yet somehow the method returns an IEnumerable. So what is really happening? The answer is one of the most elegant compiler transformations in the entire .NET ecosystem. Let's open the hood. The Illusion Most developers imagine the previous code executes like this: Call method ↓ Return 1 ↓ Pause ↓ Return 2 ↓ Pause ↓ Return 3 That isn't what happens. C# methods cannot actually pause execution. Instead, the compiler completely rewrites your method into something entirely different. The Compiler Creates a State Machine Your tiny method becomes a hidden class similar to this: private sealed class GetNumbersIterator : IEnumerable < int >, IEnumerator < int > { private int _state ; private int _current ; public bool MoveNext () { switch ( _state ) { case 0 : _current = 1 ; _state = 1 ; return true ; case 1 : _current = 2 ; _state = 2 ; return true ; case 2 : _current = 3 ; _state = - 1 ; return true ; default : return false ; } } public int Current => _current ; } Your original method no longer exists. Instead, it simply returns: return new GetNumbersIterator (); Every yield return becomes another state inside MoveNext(). Why Local Variables Don't Disappear Consider this code: IEnumerable < int > Squares () { int x = 1 ; while ( x <= 3 ) { yield return x * x ; x ++; } } After the first yield, the method "pauses." But where is x stored? Not on the stack. The original stack frame has already disappeared. Instead, the compiler promotes local variables into fields: private int _x ; The iterator object now owns every variable that must survive between iterations. This is why iterator methods can remember where they left off. Heap Allocation Happens Ma

2026-07-19 原文 →
AI 资讯

DocuSeal: An Open-Source Alternative for Digital Document Signing and Processing

What Changed DocuSeal has emerged as an open-source platform for digital document signing and processing. This project offers a self-hostable alternative to commercial services, allowing organizations to manage document workflows, eSignatures, and form filling within their own infrastructure. The platform is designed to be accessible, mobile-optimized, and integrates with existing systems through APIs and webhooks. Technical Details DocuSeal provides a comprehensive set of features for digital document management. Key functionalities include a WYSIWYG PDF form fields builder that supports 12 field types, such as Signature, Date, File, and Checkbox. It accommodates multiple submitters per document and automates email notifications via SMTP. For file storage, DocuSeal offers flexibility, supporting local disk storage as well as cloud providers like AWS S3, Google Storage, and Azure Cloud. The platform implements automatic PDF eSignature generation and includes a mechanism for PDF signature verification, addressing security and compliance requirements. User management is integrated, and the UI is mobile-optimized, supporting 7 UI languages with signing capabilities in 14 languages. Integration with other systems is facilitated through a robust API and webhooks. Deployment options are varied, catering to different infrastructure preferences. DocuSeal can be deployed on cloud platforms such as Heroku, Railway, DigitalOcean, and Render. For containerized environments, Docker images are available, allowing for deployment via docker run commands. By default, the Docker container utilizes an SQLite database, but it can be configured to use PostgreSQL or MySQL by setting the DATABASE_URL environment variable. Docker Compose configurations are also provided, enabling deployment with custom domains and automatic SSL certificate issuance via Caddy. Pro features, available through commercial offerings, extend the platform's capabilities to meet business needs. These include compa

2026-07-19 原文 →
AI 资讯

What is Django? A Complete Guide to the Django Framework, Benefits, Use Cases & Getting Started

In today's world where websites and web applications play a very important role in businesses, choosing the right tool for developing a project is of great importance. Developers usually use frameworks to build websites faster, more securely, and more professionally. One of the most powerful and popular web development frameworks is Django . Django is a powerful and open-source web framework built with the Python programming language that allows developers to create complex and professional websites and web applications in a short amount of time. From simple websites to large systems, online stores, social networks, admin panels, and professional APIs — all can be developed with Django . In this article, we will thoroughly examine what Django is, why it has become popular, what its use cases are, and why many developers and large companies use it. What is a Framework? Before we get to know Django , it's better to understand the concept of a framework. A framework is a collection of pre-built tools, libraries, and rules that help developers build software faster and with better structure. In the past, developers had to create many features from scratch; for example: User login system Database connection Request management Application security Page structure File management But by using a framework, many of these capabilities are already prepared, and the developer can focus on the core logic of the project. Simply put, a framework is like a ready-made skeleton for building software that increases the speed and quality of development. What is Django? Django is a server-side (backend) web development framework written in Python . This framework is designed for building web applications and provides developers with many features by default. The main goal of Django is to make web development faster, more secure, more organized, and more scalable. Django's official slogan: The web framework for perfectionists with deadlines This slogan indicates that Django was built for

2026-07-19 原文 →
AI 资讯

Trust the Calculator

The pricing formulas in Motor, the estimating engine I built for a water feature shop, did not come from the manual. I pulled 32 of them out of the JavaScript behind Aquascape's contractor calculator, the tool contractors actually use to bid jobs. The manual was sitting right there, official and free. Ignoring it was the best design decision in the whole system. A vendor never ships a sloppy calculator Why trust the calculator over the manual? Because of what happens when each one is wrong. If the manual sizes a pump wrong, a reader shrugs and moves on. If the calculator sizes a pump wrong, a contractor bids a job at that number, wins it, and loses money on the install. Then the phone rings. So calculators get fixed and manuals drift. Give it ten years and the two quietly disagree, and everyone in the trade knows which one to trust without anyone saying so. A vendor will ship a sloppy PDF. They will never ship a sloppy calculator. Documentation is what a domain says about itself. The artifacts money flows through are what it actually believes. Once you see that split, you cannot stop seeing it. The other half was in old invoices Formulas only get you to cost. What a shop charges on top of cost is a belief about its market, and no vendor document holds that number. So I pulled 132 historical quotes out of the shop's CRM. Real quotes, sent to real customers, most of them paid. I calibrated Motor's markup against those, then checked its output against what the shop had actually charged. The result: Calibrated against 132 real quotes, Motor's estimates landed within 5 percent of what the shop actually charged, with no pricing rule taken from documentation. I could have just asked the owner what his markup was. But what an owner says and what his invoices show are rarely the same number, and the invoices are the ones customers paid. When the two disagree, believe the invoices. The same bug in a different industry I build and run systems in several industries, and the sur

2026-07-19 原文 →
AI 资讯

Customizable workout app

If you are like me, then you have also tried to change a specific thing in your workout plan that your app of choice didn't support. Well I'm trying to fix that issue with a workout app in which you'll be able to customize pretty much everything (WIP). Building the thing in Flutter to have mobile (starting with Android) and web. The web app is live! If you work out and have tried similar apps before, your feedback would be gold. But really any feedback is appreciated. I also found that finding the required 12 people with an Android phone for closed testing on Google Play Console was more difficult than anticipated. So if you'd be interested in that, hit me up at dev@notes.fitness ! Gym Notes — A Customizable Workout Logbook for Strength Training A free, customizable workout logbook that tracks exercises, sets, reps, and weights. Built-in training plans with automatic progression. gym.notes.fitness

2026-07-19 原文 →
AI 资讯

Make the Fake Impossible

Every patient in the public tour of my care platform is a computer science pioneer. Ada Lovelace has a pain score. Alan Turing is due for a check-in. And every one of them has a patient ID no real system could ever issue, an ID that is wrong the way a date in month thirteen is wrong. None of this is an accident. It is the most useful compliance idea I have had this year. A good fake is a liability Here is the problem with realistic demo data. Under HIPAA, nobody can tell a well-made fake from the real thing by looking. A screenshot of a fake patient named John Smith with a plausible ID looks exactly like a screenshot of a real one. So when that image turns up in a deck, or a tweet, or a forwarded email, someone has to prove it is clean. And the only way to prove it is to go back to the database and show the record does not exist. That is an audit. Every plausible fake carries a future audit inside it. So a good fake does not reduce your risk. It just moves it. The better the fake looks, the more it costs to prove it is one. The safety of a fake is not in how real it looks. It is in how obviously fake it is. A plausible fake needs an audit to clear it. An impossible fake clears itself. The fix is to stop making fakes plausible and start making them impossible. A patient named Grace Hopper with an ID that breaks the format on sight cannot be a real record. Anyone can check that from the pixels alone. No lookup, no audit trail, no meeting. Zero pixels The public showcase at clearpathcare.ai contains zero pixels from the production console. Every screen is a React recreation, rebuilt by hand to look like the product without ever touching it. What broke: An early draft of the marketing screens started as console screenshots with seeded test patients: realistic names, realistic IDs. Then I asked one question the images could not answer: prove there is no real record in this frame. I could not. So I deleted every screenshot and rebuilt the screens from scratch. The rebuilt

2026-07-19 原文 →
AI 资讯

wp-admin inaccessible : le protocole de diagnostic en 6 étapes

WordPress affiche une page blanche, un 403, ou la boucle de connexion infinie sur /wp-admin : voici le protocole de diagnostic que nous utilisons, dans l'ordre, avec les commandes exactes. 1. Identifier le type de blocage Trois familles de symptômes, trois causes différentes : 403 Forbidden : règle serveur ( .htaccess , WAF, IP bannie) ou cookies corrompus Boucle de redirection login : problème de cookies/HTTPS mal déclaré ( WP_HOME / WP_SITEURL ) Page blanche (WSOD) : erreur PHP fatale, souvent une extension ou le thème 2. Le fix express des cookies (cause n°1 du 403) Avant de toucher au serveur, videz les cookies du domaine et testez en navigation privée. Si ça passe en privé, c'est un cookie corrompu — pas le serveur. Le détail complet du mécanisme est dans notre guide WordPress erreur 403 et cookies bloqués . 3. Désactiver les extensions sans wp-admin # Via WP-CLI (le plus propre) wp plugin deactivate --all # Sans WP-CLI : renommer le dossier mv wp-content/plugins wp-content/plugins.off Si wp-admin revient, réactivez une par une pour isoler la coupable. 4. Vérifier .htaccess et les règles serveur Un .htaccess corrompu ou une règle de sécurité trop stricte bloque l'accès admin. Régénérez un fichier propre (Réglages → Permaliens, ou à la main). Pour générer des règles saines — protection wp-login, anti-hotlink, cache navigateur — sans risquer la syntaxe, nous maintenons un générateur de .htaccess WordPress gratuit . 5. Purger tous les caches (souvent oublié) Un cache de page qui sert une vieille version de wp-login provoque des boucles incompréhensibles. Purgez dans l'ordre : cache navigateur, cache de page (extension), cache serveur (LiteSpeed/Varnish), OPcache. La méthode complète par type de cache : comment vider le cache WordPress . 6. Le guide complet Chaque étape ci-dessus est développée (avec les cas 404 wp-admin, erreur critique, mot de passe perdu via WP-CLI et phpMyAdmin) dans notre guide de référence : accéder à wp-admin : connexion et administration Wo

2026-07-18 原文 →