r/LangChain

Built an offline harness that conforms to your agent loop, not the other way around
▲ 16 r/LangChain+5 crossposts

Built an offline harness that conforms to your agent loop, not the other way around

I have been trying a bunch of harness models and frameworks for the last month, and I realize most agent frameworks want you to rebuild your runtime around their harness.

We went the other way with AURA Harness: a thin membrane around loops you already run, plain Python, Ollama, LangGraph, whatever. You keep the body/runtime, while AURA records and optionally gates what crosses the boundary. Shouldn't this be what harness is about??

Local-first by default:

  • Works offline with agent_ref + session IDs, no cloud identity required
  • integrations/ollama/llama_loop.py, stdlib HTTP against Ollama (llama3.2:1b is our dev default)
  • Optional verified operator identity if you need it later, not required for OSS/dev

What you get on close: JSONL spine, audit report, hash chain, aura verify chain for CI.

Loose coat = audit-only logging. Tight coat = rules/gates at egress when you wire tool paths.

Open source (Python): github.com/ARPAHLS/aura

Happy to answer setup questions, especially Ollama related + “wrap my script, don’t replace it.”

Contributors more than just welcome, bunch of good first issues open <3

u/RossPeili — 8 days ago

Analyse massive documents with AI

Hi everyone,

I work at a large telecom company in the US. When we win a tender, the client sends us a requirements specification, and we write technical deliverables based on it and on our internal technical documentation (100k+ documents). A single tender can involve thousands of deliverables, some of them up to ~600 pages long.

Goal: before delivery, automatically verify each deliverable. That means checking that the facts it contains are accurate against our technical documentation, and detecting anomalies (errors, internal contradictions, inconsistencies between deliverables, duplicates).

Current plan:

  1. Fact extraction: process each deliverable in chunks with an LLM and extract atomic facts, with their source location.

  2. Classification: group the facts into families (measurements, architecture, calculations, frequencies, standards, quantities).

  3. Verification: check each fact against the documentation base using RAG.

  4. Anomaly detection: one LLM call per fact category to detect duplicates, contradictions, etc.

My questions:

- Is there a recommended approach for extracting precise facts from very long documents? How do you handle context that spans chunks ?

- How do you make sure extraction is complete (no missed facts) and doesn't produce hallucinated facts?

- For anomaly detection, does one LLM call per category scale when a category can contain thousands of facts? Would you normalize facts into a structured schema (entity / attribute / value / unit) and do part of the comparison deterministically in code rather than with an LLM?

- For RAG verification on highly technical content (part numbers, frequencies, references to standards), did hybrid search (BM25 + embeddings) or reranking make a big difference for you?

- Any experience comparing long-context models (1M tokens) with chunked extraction for this kind of task?

Any feedback, papers, tools or lessons learned would be much appreciated. Happy to share what we learn along the way.

Thanks

reddit.com
u/louey11 — 8 days ago

Where should file artifacts live when a LangGraph run can pause and resume?

A checkpoint can preserve graph state, but generated files have a different lifecycle. Reports, HTML bundles, images, and spreadsheets may be too large for messages, may change independently, and may need a stable review link after the run that created them has ended. Storing only a temporary path or signed URL makes a later resume fragile. Storing the bytes inside graph state makes checkpoints heavy and blurs workflow state with durable output.

One approach is immutable artifact revisions in object storage plus a small manifest in authoritative state. The manifest would carry an artifact ID, revision, checksum, media type, source revisions, producer node, review status, and a stable resolver. Graph state would reference the manifest revision, while messages receive only the summary needed for reasoning. A resumed node would reject a stale expected revision rather than overwrite newer work.

How are LangChain and LangGraph users drawing this boundary? What belongs in messages, checkpoints, the Store, or external object storage, and how do you keep cleanup, permissions, and retries consistent across those layers?

reddit.com
u/RocketSeven — 8 days ago

Updated my tool-call gate after the feedback — what's still missing?

Follow-up to my previous post: https://www.reddit.com/r/LangChain/comments/1wo5bxo/i_built_a_local_runtime_check_for_ai_agent_tool/

>That thread got a lot of sharp feedback - schema pinning on MCP, server-side intent, real hostname allowlists, SSRF/IMDS, and REQUIRE_APPROVAL as a real gate instead of a log line. I took most of it and shipped v0.2.4.

Repo: https://github.com/aegotrax-dev/aegotrax (tag v0.2.4)
Site: https://aegotrax.com

**What's new in 0.2.4**
- Server-side session intent only (client can't spoof user_intent on verify)
- Hostname allowlists (no substring bypass) + SSRF/IMDS in engine and gateway
- MCP schema pinning + drift detection
- REQUIRE_APPROVAL → approval_id + single-use token → POST /approval/decide → one resume for the same tool+args
- Session TTL, per-session rate limit, audit redaction 

**What it still is not**
- Not a production / enterprise security product
- Not full intent understanding (heuristics + thresholds)
- Not volume caps on sensitive reads yet (slow in-scope exfil without outbound is still a gap) 

**Try**
```bash
git clone https://github.com/aegotrax-dev/aegotrax.git
cd aegotrax
pip install .
agentguard-engine
# curl http://127.0.0.1:8000/health  → version 0.2.4
python examples/approval_flow_demo.py  

Curious how others handle the split: "this identity can call this API" vs "this call is still what the user asked for."

u/GameChacking — 8 days ago

Where does agent waste actually come from: model calls or orchestration?

I’ve been digging into a problem I think agent observability still misses.

Most tools can tell us what an agent called, how many tokens it used, and what it cost.

But the more useful question is:

Why did those calls happen at all?

I started looking at this after AUDR came out and built a small open-source CLI called KORA Doctor to inspect agent traces.

Right now it looks for things like:

  • repeated model calls
  • missed cache or reuse
  • deterministic work sent to an LLM
  • expensive models doing simple work
  • excessive planning and orchestration

The first useful feedback changed my thinking.

Someone running agents in production told me their biggest source of waste wasn’t repeated inference.

It was re-fetching the same tool data across multiple steps.

That means the waste can start before the model call. The orchestration layer can create unnecessary retrieval, tool calls, retries, and then more inference on top of that.

So I’m starting to think the bigger problem isn’t just “LLM cost optimization.”

It’s execution waste across the whole agent run.

For people running real agents:

Where do you see the most waste?

Model calls?
Tool calls?
Retries?
Retrieval?
Planning loops?
Repeated validation?
Something else?

I’m building KORA Doctor around what shows up in real traces, so production examples are especially useful.

AUDR:
https://openaudr.dev/

KORA Doctor:
https://github.com/Krako-Labs/kora-doctor

u/NervousPengwin — 8 days ago

Agent built with LangGraph ran unattended overnight on a refactor. Redid two completed nodes that had already finished correctly hours earlier.

No crash, no error, no retry logged. It just circled back through nodes whose state said done and reprocessed them anyway, once with a slightly different naming convention than the first pass, overwriting the correct output with a worse one.

Assumed model drift at first. Doesn't fully explain it, the same model used interactively over a comparably long session doesn't usually fail this way nearly as often. The actual difference is that an interactive session has a human quietly doing a job nobody assigned them, noticing when a subtask's done and moving on, and the next message implicitly signals that shift without ever stating it outright.

A graph running unattended through a long task list has nothing playing that role by default. Even with state tracked per node, if the full working detail from completed nodes stays accessible in whatever gets fed into the next step's context, it's still competing for attention with the actual current step, not just sitting there as a settled fact. On a long run, that accumulates at the same rate as the task itself.

What's actually helped: explicitly collapsing a finished node's output into a short completion summary before it enters downstream context, instead of carrying the full reasoning trail forward, and treating a node's "done" state as something that actively shrinks what it contributes to context, not just a status flag nobody reads.

Wrote the longer version of this up here if useful: https://medium.com/@nagatomopedro05/unattended-ai-agents-have-a-context-problem-humans-never-had-60961eb2d4e7

u/ClickOk5811 — 8 days ago

The "agents need memory vs just use documentation" argument keeps going in circles, mostly because "memory" is three different problems

If you follow the agent threads here, you have watched the "do agents need memory or just documentation" argument go in circles. Most of that, we think, is that "memory" covers three separate problems, and each camp is defending a different one.

First is keeping state inside one session. In LangGraph that is the checkpointer, keyed by a thread_id, and it lets a run pause and resume with state intact. The edge that catches people: when a node hits an interrupt and you resume, the whole node runs again from the top. Any tool call or write before the interrupt fires again on every resume, which is why the docs insist anything before an interrupt be idempotent.

Second is remembering across sessions. That is the Store, separate from the checkpointer, namespaced per user, searchable later. It is the piece the "you need a memory layer" people mean, and where the cost hides: as it grows, a naive setup spends tokens reading and refreshing it even on tasks that never needed it, and a fact true three months ago still sits there with nothing marking it stale.

Third is what fits in the context window each call. LangGraph treats this as context management, separate from the two memory types above, though the argument lumps it in. Trim or summarize old turns too hard and the agent re-asks for a detail the user gave two turns back, because the summary dropped it.

Split those three and the argument reads differently. The documentation camp is mostly on the third problem and part of the second. The memory-layer camp is almost always on the second. Same word, three problems, which is why it keeps circling.

So which of the three has you stuck? On the cross-session one, the contested piece, what breaks first: store bloat that makes simple tasks pay for memory they never needed, or stale entries with no clean way to retire them? We're curious what people have landed on.

reddit.com
u/Future_AGI — 8 days ago
▲ 0 r/LangChain+1 crossposts

A chunking lib in Rust that is ~20x faster

Hey,

I wanted a faster chunking library for my system without affecting the overall accuracy. Did not find many options. So I've build https://github.com/d1pankarmedhi/chunkr

It has most of the chunking strategies like Character, Recursive, Markdown header, Late chunking, Hierarchical chunking, etc. It also supports native PDF loader, and other additional file types.

Some stats (MBA M4 16GB):

Test Case (matched parameters) Chunkr LangChain LlamaIndex Chonkie semchunk text-splitter
Recursive (1 MB, 1000/200) 2,264 MB/s 769 MB/s 10 MB/s 225 MB/s 42 MB/s 175 MB/s
Recursive (5 MB, 1000/200) 2,039 MB/s 696 MB/s — 201 MB/s 40 MB/s 46 MB/s
Fixed Char (1 MB, 1000/200) 750 MB/s 1.7 MB/s — 22 MB/s — —
Markdown (500 KB, 1000/150) 819 MB/s 67 MB/s 19 MB/s — — 40 MB/s
Python Code (200 KB, 1500/200) 3,232 MB/s 622 MB/s — — — 5.7 MB/s
Sentence (500 KB) 622 MB/s — 10 MB/s 20 MB/s — —
BPE Tokens (200 KB, cl100k_base, 512/50) 38 MB/s 43 MB/s 2.0 MB/s 151 MB/s — 7.2 MB/s
100 docs x 50 KB (parallel batch) 3,224 MB/s 679 MB/s — 213 MB/s — —

Extractor / Pipeline Latency Throughput Speedup vs PyPDF
Chunkr PDFLoader (Full Text) 747.9 ms 2,762 pgs/s 15.9x Faster
Chunkr PDFLoader (Page Documents) 721.0 ms 2,865 pgs/s 16.5x Faster
PyMuPDF (fitz) 2,616.8 ms 789.5 pgs/s 4.5x Faster
pypdf (pure Python) 11,900.5 ms 173.6 pgs/s 1.0x (baseline)
Chunkr End-to-End (PDF + Recursive) 798.1 ms 2,589 pgs/s 14.9x Faster
PyMuPDF + LangChain RecursiveTextSplitter 2,659.3 ms 776.9 pgs/s 4.5x Faster
pypdf + LangChain RecursiveTextSplitter 12,054.5 ms 171.4 pgs/s 1.0x (baseline)

Do check it out and share your feedback. Thanks!

reddit.com
u/Ok_Cartographer5609 — 10 days ago