📣 We ran chunk_size=300 on the same document across three frameworks. SynapseKit: 12 chunks. LangChain: 12 chunks. LlamaIndex: 2 chunks. Same parameter. Same document. Order of magnitude difference in output. Zero error messages. Here's what's happening: LlamaIndex's SentenceSplitter interprets chunk_size as tokens, not characters. chunk_size=300 means 300 tokens — roughly 1,200 characters. On a 1,972-character document that gives you 2 chunks averaging 986 characters each instead of the 12 chunks averaging 163 characters you'd expect. This is documented behavior. It is also the most common source of confusion when engineers copy parameters from a LangChain tutorial into LlamaIndex. Same parameter name. Completely different semantics. Your retrieval quality changes by an order of magnitude and nothing tells you why. The rule: never copy chunk parameters across frameworks without checking the unit. chunk_size=300 means... SynapseKit → 300 characters → 12 chunks LangChain → 300 characters → 12 chunks LlamaIndex → 300 tokens (~1,200 chars) → 2 chunks ⚠ A few other things worth knowing from this benchmark: LangChain ships 8 built-in splitters. LlamaIndex ships 9. SynapseKit ships 2. But two of LlamaIndex's splitters — SentenceWindowNodeParser and HierarchicalNodeParser — have no equivalent in the other frameworks and solve real production problems that the others don't address at all. LangChain's standalone splitter API is the most debuggable. You can inspect chunks before indexing. SynapseKit's chunking is opaque — parameters live on the Retriever and you can't see the split before it's indexed. Chunking is not configuration. It's architecture. The split you choose affects embedding quality, retrieval precision, and whether your LLM gets enough context. The tutorials that sprint past it in two lines are the same tutorials whose RAG demos fall apart on real documents. Full benchmark + reproducible Kaggle notebook → engineersofai.com #Python #AI #LLM #RAG #MLEngineering #OpenSource #AIEngineering #EngineersOfAI #SynapseKit
Chunking Differences Between SynapseKit LangChain LlamaIndex
More Relevant Posts
-
My AI agent spent 20 minutes debugging the wrong file. I only know because I built the thing that caught it. A few weeks ago I built agent-replay-debugger - a CLI that turns agent session traces into interactive timelines. v1 was basically a fancy log viewer. It told you what happened (the agent read 40 files) but not why it read 40 files when it only needed 3. So I added --analyze. One flag, and every reasoning block gets classified by an LLM: is the agent planning? investigating? implementing? Or - my personal favorite - is it backtracking because it just realized it's been editing the wrong file for the last 15 minutes? On a real 2-hour session with 600+ events, I got exactly 2 red flags. Those 2 flags were worth more than the other 598 events combined. Total cost of running the analysis: 2 cents. What else is new: The viewer used to show one flat blob per session. Now each user message creates its own span - a 2-hour session becomes 33 clickable nodes in the DAG, each showing how long the agent spent and how many tool calls it made. You can instantly see that "PR 1" took 2 hours and 83 tool calls while "list issues" took 10 seconds and 1 call. Also shipped a pick command because I got tired of copy-pasting UUIDs: ard view $(ard pick chore-champions) Still zero runtime dependencies. Still pure Python stdlib. 188 tests, 100% coverage enforced in CI. The --analyze flag talks to the Anthropic API using urllib - no SDK needed. Live demo (real session, LLM-annotated, all secrets auto-scrubbed): https://lnkd.in/gRFB7uWf Code: https://lnkd.in/gPTUt4ue #buildInPublic #AIAgents #LLM #Python #OpenSource #DevTools #AIEngineering
To view or add a comment, sign in
-
📣 Every LLM framework eventually adds async support. SynapseKit started there. There's a difference between async-retrofitted and async-native. Most frameworks started synchronous, bolted async on later, and shipped the seams - hidden event loop management, sync wrappers that infect the core, bugs that only surface under concurrent load. SynapseKit was designed async-first from the first commit. Every public API is async/await. No exceptions. No hidden sync layers underneath. If you understand Python and async, you understand SynapseKit. What that means in practice: → Stream tokens from any of 33 providers identically- not a special mode, the default → Run parallel graph nodes via real asyncio.gather - not simulated concurrency → No event loop surprises under load → Sync wrappers exist for scripts and notebooks - they call into the async layer, they don't replace it And the dependency story: 2 hard dependencies. numpy and rank-bm25. That's it. Everything else - LLM providers, vector stores, document loaders, tools - is behind an optional install extra. You pay only for what you use. No transitive conflicts. No 267-package installs. No surprise breakage when a framework you didn't know you depended on ships a breaking change. pip install synapsekit[openai] # 2 deps + openai pip install synapsekit[all] # everything Async-native. Minimal. Transparent. #Python #AsyncPython #LLM #RAG #OpenSource #AI #MLEngineering #SynapseKit
To view or add a comment, sign in
-
Your containerized AI agent just consumed 47GB of RAM processing a 2MB JSON file. Spent the weekend tracking down a memory leak in our document processing agent. The culprit? Loading entire JSON objects into memory when we only needed to stream and parse specific fields. The fix was embarrassingly simple: - Switched from json.load() to ijson for streaming - Added proper memory cleanup after each document - Implemented chunked processing for large files Memory usage dropped from 47GB to 180MB. Same processing time, 99.6% less memory. Sometimes the best optimization isn't adding more resources - it's using what you have smarter. What's the worst memory leak you've had to debug? --- Want to automate your workflows or build AI-powered systems for your business? DM me — I help teams ship automation that actually works. #BuildInPublic #DevLife #Python #AIAgents #MemoryOptimization #Performance #Docker #TechDebt
To view or add a comment, sign in
-
-
I've been using JSON to pass structured data to LLMs since day one. It works. But I never questioned whether it was the right format. Then I came across TOON. Token-Oriented Object Notation. Same idea as JSON but built specifically for LLM prompts. The claim: 30 to 60 percent fewer tokens for the same structured data. JSON was designed for machines talking to machines. Every key is quoted, every bracket is explicit. That's fine when you're not paying per token. But when you're running LLMs in production, all that verbosity adds up fast. TOON strips out the noise. Still human-readable, still schema-aware, just a lot leaner. I haven't fully switched yet but the benchmarks are hard to ignore. If you're sending structured context to a model hundreds of times a day, the savings are real. Worth keeping an eye on. Implementations already exist for TypeScript, Python, Rust and a few others. Have you tried anything other than JSON for structured LLM input? #AI #LLM #AIEngineering #BuildingWithAI #DeveloperTools #MachineLearning #SoftwareDevelopment
To view or add a comment, sign in
-
-
Just finished building a custom Retrieval-Augmented Generation (RAG) Chatbot from scratch. Over the past few days, I have been diving deep into Generative AI architecture and successfully built a conversational AI engine that goes beyond the basic LLM cutoff limits by proactively reading and learning from my own offline knowledge base. Technical Stack & Implementation Details: • Python & LlamaIndex for core logic and RAG orchestration • Groq integrated to power ultra-fast inference leveraging the Llama 3 (70B) model • HuggingFace's sentence-transformers (`all-MiniLM-L6-v2`) used locally to map large document bodies into embedded semantic vectors. Key Milestones: • Vector Store Indexing: Implemented a process to automatically ingest raw textual data, logically split it, mathematically embed it, and securely cache the mathematical vectors in local storage. • Semantic Retrieval: Designed the query engine to capture conversational inputs, perform mathematical similarity searches against the cache, and inject the `Top_K` most relevant context chunks directly into the model's awareness. • Context Management: Bypassed token degradation and rate limits in long conversations by utilizing LlamaIndex's `ChatSummaryMemoryBuffer` to condense older history chunks without losing context. I am proud of the clean, modular "Separation of Concerns" codebase that powers this engine efficiently. Check out the code and architectural setup on my GitHub: https://lnkd.in/dFcYyZM2 #AI #GenerativeAI #MachineLearning #Python #LlamaIndex #Groq #RAG #SoftwareEngineering #DataScience
To view or add a comment, sign in
-
𝐒𝐭𝐨𝐩 𝐑𝐞𝐚𝐝𝐢𝐧𝐠 𝐂𝐨𝐝𝐞. 𝐒𝐭𝐚𝐫𝐭 𝐌𝐚𝐩𝐩𝐢𝐧𝐠 𝐈𝐭 Most RAG tools treat your codebase like a flat text file. They miss the "why" behind the "what." I built Codebase Architect: A Full-Stack GraphRAG agent that understands your repository's structural DNA using Static Analysis (AST) and Graph Theory. 𝑾𝒉𝒚 𝑮𝒓𝒂𝒑𝒉𝑹𝑨𝑮? Standard RAG retrieves snippets. GraphRAG retrieves relationships. By mapping dependencies across the stack, this tool doesn’t just answer questions—it predicts the future of your code. 🛠️ 𝑾𝒉𝒂𝒕 𝒊𝒕 𝒂𝒄𝒕𝒖𝒂𝒍𝒍𝒚 𝒅𝒐𝒆𝒔: Blast Radius Analysis: Ever changed a function and prayed nothing broke? Using BFS on a dependency graph, it identifies exactly which modules are at risk before you commit. Polyglot Mapping: It bridges the gap between your Python backend and JS/TS frontend by identifying shared API contracts. Functional Neighborhoods: Uses the Leiden Algorithm to cluster code into logical "neighborhoods," summarized by Llama-4 for instant architectural clarity. High-Speed Ingestion: Shallow cloning and thread-pooled LLM requests mean you're indexed and ready in seconds, not minutes. The Tech Stack: Engine: FastAPI + iGraph for high-performance graph processing. Brain: Groq (Llama-3/4) for lightning-fast contextual summaries. Interface: Streamlit for real-time "Impact Alerts" and chat. Stop guessing how your microservices talk to each other. Let the graph show you. 👇 C̳h̳e̳c̳k̳ ̳o̳u̳t̳ ̳t̳h̳e̳ ̳r̳e̳p̳o̳ ̳h̳e̳r̳e̳: [https://lnkd.in/dJmMjX8g] #GraphRAG #AI #SoftwareEngineering #Python #LLM #OpenSource
To view or add a comment, sign in
-
I added memory to my chatbot — and what I expected to be a minor upgrade turned into a bit of a "wait, this is actually cool" moment. Version 1 was straightforward: ask a question, get an answer, start fresh next time. Useful, but cold. Like a vending machine that also talks. Version 2 remembers you. Not in some fancy way — it's literally reading and writing to a .txt file. But because LangChain feeds that history back into the model at every turn, the conversation has continuity. You can say "remember what I told you earlier?" and it actually can. Building it made me realize: memory isn't just a feature. It's the thing that makes an AI feel like it's actually *with* you instead of just responding *to* you. The stack is still simple — Python, LangChain, Ollama running LLaMA 3.2 locally. No external APIs, no data leaving my machine. Where I want to take it: — Smarter memory with a vector database — Distinguishing between what to remember long-term vs short-term — A proper UI so it doesn't live only in a terminal It's still early. But it's starting to feel like I'm building something, not just tinkering. Code link is in the comments. 👇 #AI #MachineLearning #Python #LangChain #Chatbot #BuildInPublic #GenAI
To view or add a comment, sign in
-
I’ve been building a side project: a web-based combat tracker for a custom TTRPG. You can check out the repo here: https://lnkd.in/dZrM-mhe. I ran the full delivery loop, requirements through tests, while tightening agentic pipelines so they could run on trial-tier models and still land close to what I'd get from heavier ones. The bet was that clearer prompts and smaller scopes would do more than burning tokens, and that's where most of the learning actually happened. On the app itself: I drafted and refined requirements and scope in markdown in the repo (requirements-done, backlog notes) so changes could be checked against written intent. I used those pipelines to turn ideas into small, agent-ready stories. For design, Stitch let me iterate on layout and tone early; screens were then built as Flask templates and static assets so they still matched real routes, forms, and Socket.IO events. The stack is Flask + SQLAlchemy + SQLite, with Socket.IO for live updates; I added pytest where it helped, plus browser automation only where it paid off, and a one-command DB init so a fresh clone isn’t blocked on missing tables. The Python backend is mine line by line, with AI used in a teaching / review mode rather than "write the app for me" mode, which for me beat a generic paid course. This isn't evidence that agents replace engineers. It's one more example of using AI as leverage on a loop you still own. If you're trying something similar, the README and branch layout are meant to read without insider context; you're welcome to reuse the Skills in the repo if they help. If you’re using Cursor or similar tools, the practical suggestion is the same: treat AI as leverage on that loop, not as a substitute for thinking. #Python #Flask #Cursor #AgenticAI #OpenSource #TTRPG
To view or add a comment, sign in
-
-
PSA: Check your AI-generated requirements files before they nuke production. I've noticed a pattern — when you ask an AI to write a requirements.txt or environment.yml, it almost always reaches for >=: flask>=2.3.0 sqlalchemy>=2.0.0 pydantic>=2.5.0 Looks reasonable, right? It's not. Here's what actually happens six months later when you deploy to a fresh server: 1. Pydantic 2.x → 3.x ships a breaking change. Your entire validation layer silently starts rejecting payloads that worked yesterday. No error on install. Just 500s at runtime. 2. SQLAlchemy quietly drops a deprecated API. Your ORM queries that ran fine for a year now throw AttributeError deep in a call stack. Good luck debugging that at 2 AM. 3. Flask upgrades and one of its pinned sub-dependencies conflicts with yours. Now pip install itself fails and your CI/CD pipeline is just... red. Indefinitely. On code you never changed. 4. NumPy 2.0 lands. Half the scientific Python ecosystem isn't compatible yet. Your data pipeline that "just works" no longer does — on a Monday morning, naturally. The fix is boring: pip freeze > requirements.txt Pin with ==. Every time. In production, reproducibility isn't a nice-to-have — it's the whole game. If an AI generates your dependency file, treat it like any other code review. The convenience of >= is a deferred incident report. #Python #DevOps #SoftwareEngineering #AI #LessonsLearned
To view or add a comment, sign in
-
Enjoy staring at someone else's code? You're a certified psychopath. 🚩 What if you could open a codebase you've never seen before and 𝗶𝗻𝘀𝘁𝗮𝗻𝘁𝗹𝘆 𝘂𝗻𝗱𝗲𝗿𝘀𝘁𝗮𝗻𝗱 𝗲𝘅𝗮𝗰𝘁𝗹𝘆 𝗵𝗼𝘄 𝗶𝘁 𝘄𝗼𝗿𝗸𝘀? We aren't built to process endless text just to build a mental model, 𝘄𝗲 𝗻𝗲𝗲𝗱 𝗺𝗮𝗽𝘀. 𝗦𝗼, 𝗜 𝗯𝘂𝗶𝗹𝘁 𝗼𝗻𝗲. 👇 This is an interactive AST Explorer 🗺️ (ANTLR4 + Python + Plotly). Instead of blindly scrolling, you click to visually "zoom into" the exact architecture of the code. 𝗕𝘂𝘁 𝘀𝗲𝗲𝗶𝗻𝗴 𝘁𝗵𝗲 𝘀𝘁𝗿𝘂𝗰𝘁𝘂𝗿𝗲 𝗶𝘀 𝗷𝘂𝘀𝘁 𝗣𝗵𝗮𝘀𝗲 𝟭. Phase 2 is mapping the logic. The engine will soon generate Control Flow (CFG) and Data Flow Graphs (DFG), feeding them directly into a Contextual RAG AI. The goal? You ask the AI: "𝘐𝘧 𝘐 𝘮𝘰𝘥𝘪𝘧𝘺 𝘵𝘩𝘪𝘴 𝘤𝘰𝘮𝘱𝘰𝘯𝘦𝘯𝘵, 𝘸𝘩𝘢𝘵 𝘣𝘳𝘦𝘢𝘬𝘴 𝘥𝘰𝘸𝘯𝘴𝘵𝘳𝘦𝘢𝘮?" Instead of guessing, it traces the mathematical execution path and gives you the 𝗲𝘅𝗮𝗰𝘁 𝗮𝗻𝘀𝘄𝗲𝗿. 𝗨𝗻𝗱𝗲𝗿𝘀𝘁𝗮𝗻𝗱 𝗮𝗻𝘆 𝗰𝗼𝗱𝗲 𝘄𝗶𝘁𝗵 𝗲𝗮𝘀𝗲. 𝗭𝗲𝗿𝗼 𝗴𝘂𝗲𝘀𝘀𝘄𝗼𝗿𝗸. 𝗡𝗼 𝗼𝗿𝗶𝗴𝗶𝗻𝗮𝗹 𝗱𝗲𝘃𝗲𝗹𝗼𝗽𝗲𝗿 𝗿𝗲𝗾𝘂𝗶𝗿𝗲𝗱. Follow along, I'm building this in public. 🚀 Ever inherited a codebase with zero docs? Drop a 🙌 below. 👇 #SoftwareEngineering #Python #AgenticAI #DeveloperTools #LegacyCode #BuildingInPublic #AI
To view or add a comment, sign in
More from this author
Explore content categories
- Career
- Productivity
- Finance
- Soft Skills & Emotional Intelligence
- Project Management
- Education
- Technology
- Leadership
- Ecommerce
- User Experience
- Recruitment & HR
- Customer Experience
- Real Estate
- Marketing
- Sales
- Retail & Merchandising
- Science
- Supply Chain Management
- Future Of Work
- Consulting
- Writing
- Economics
- Artificial Intelligence
- Employee Experience
- Workplace Trends
- Fundraising
- Networking
- Corporate Social Responsibility
- Negotiation
- Communication
- Engineering
- Hospitality & Tourism
- Business Strategy
- Change Management
- Organizational Culture
- Design
- Innovation
- Event Planning
- Training & Development