🎩 You're Invited:Meet the Socket team at Black Hat in Las Vegas, August 3-6.RSVP β†’
Sign In

agentic-research-engine

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

agentic-research-engine

The best $0 research agent that runs on a laptop β€” local-first, CoVe-verified, with CLI / TUI / Web GUI + MCP server + Claude plugin.

pipPyPI
Version
0.1.3
Weekly downloads
100
Maintainers
1

agentic-research-engine-oss

License PyPI Version Default Tests Interfaces MCP

The best $0 research agent that runs on a laptop. Open-source end-to-end, reproducible, privacy-preserving. No cloud dependency by default; no telemetry; every LLM call, every source, and every verification decision is visible.

Table of contents

30-second pitch

Local research agent. Gemma 3 4B via Ollama + SearXNG for search + trafilatura for full-page extraction + hybrid BM25 + dense retrieval + cross-encoder reranking + Chain-of-Verification for hallucination defense. Ships as a CLI, a Textual TUI, a FastAPI web GUI, and an MCP server you can install in Claude Desktop / Cursor / Continue.

Same code runs against any OpenAI-compatible endpoint β€” swap to OpenAI, Groq, vLLM, SGLang, or Together via a single env var.

  • 3 interfaces in parallel β€” pick your flavor
  • 6 domain presets β€” general, medical, papers, financial, stock_trading, personal_docs
  • Plugin loader β€” install Claude plugins or Hermes agentskills.io skills from GitHub or local paths
  • Memory, opt-in β€” local SQLite trajectory log with semantic retrieval; wipe anytime
  • 228+ mocked tests green, all zero-network
  • MIT end-to-end

Why use this instead of…

you currently usewe give you
Perplexity / ChatGPT Deep Research / Kagi Assistantthe same reasoning-with-citations flow, local and free, with your data never leaving the machine
Perplexica self-hostedthe UX Perplexica has plus a CoVe verifier, FLARE active retrieval, adaptive compute router, and Claude-plugin packaging
Khojstronger research-specific reasoning (we're not personal-knowledge-focused), six domain presets, and an MCP server for other agents to call
gpt-researchernewer pipeline architecture, better small-model handling, observable trace, plugin ecosystem
MiroThinker-H1 / OpenResearcher-30Bthey're stronger on BrowseComp; we run on a laptop with no GPU and cost $0
Writing your own LangGraph research agentsave 2-3 months; reuse our 8-node pipeline + 30+ tested env gates + 229 tests

Honest read: on complex multi-hop reasoning benchmarks, Gemma 3 4B sits 15–25% below 30 B+ open models. We don't claim to beat GPT-5.4 Pro. We claim to be the best $0, runs-on-your-laptop, fully-open research agent in April 2026.

Quickstart β€” Mac local

Option A β€” PyPI (fastest, once v0.1.1 is published)

# 1) Local inference (Ollama + Gemma 3 4B + embedding model β€” 3.6 GB combined)
brew install ollama
ollama pull gemma3:4b nomic-embed-text

# 2) Self-hosted meta-search (Docker; optional but recommended)
docker run -d --name searxng -p 8888:8080 searxng/searxng

# 3) The engine itself
pip install agentic-research-engine

# 4) Go
export OPENAI_BASE_URL=http://localhost:11434/v1 OPENAI_API_KEY=ollama
export MODEL_SYNTHESIZER=gemma3:4b EMBED_MODEL=nomic-embed-text
export SEARXNG_URL=http://localhost:8888
agentic-research ask "what is Anthropic's contextual retrieval?" --domain papers

Option B β€” from source

# 1) Same local-inference prereqs as Option A (ollama pull + docker run)

# 2) Clone + install (gives you the CLI, TUI, Web GUI, MCP server, benchmarks, tutorials)
git clone https://github.com/TheAiSingularity/agentic-research-engine-oss
cd agentic-research-engine-oss
(cd scripts/searxng && docker compose up -d)
cd engine && make install
make smoke    # end-to-end run on the canonical "what is contextual retrieval" question

Expected wall-clock on an M-series Mac: ~45 s for a factoid, ~90 s for multi-hop synthesis. Zero dollars per query.

Quickstart β€” no install (Google Colab)

Five runnable notebooks in tutorials/:

Each notebook is self-contained, runs end-to-end on Colab free tier, no credit card required.

Three ways to drive it

CLI

engine ask "what is hybrid retrieval?" --domain papers --memory session
engine reset-memory
engine domains list
engine version

TUI (Textual β€” keyboard-driven, SSH-safe)

make tui

Three panes: sources Β· answer + hallucination flags Β· trace + memory hits. Press Enter to ask, Ctrl-M to cycle memory mode, Ctrl-L to clear, Ctrl-Q to quit.

Web GUI (FastAPI + HTMX on localhost:8080)

make gui
# open http://127.0.0.1:8080 in your browser

No auth. No cloud. No analytics. Dark theme. Streams tokens in place.

What ships

engine/ β€” the flagship

8-node LangGraph pipeline with 2026-SOTA composition: classify β†’ plan β†’ search β†’ retrieve β†’ fetch_url β†’ compress β†’ synthesize β†’ verify

Every stage is env-toggleable for leave-one-out ablation. Techniques folded in: HyDE, CoVe verification, iterative retrieval, FLARE active retrieval, question classifier router, step critic (ThinkPRM pattern), LongLLMLingua-lite compression, cross-encoder rerank (BAAI/bge-reranker-v2-m3), Anthropic contextual chunking, W6 small- model hardening (three-case synthesize prompt + per-chunk char cap).

core/rag/ β€” reusable retrieval primitives (v1 stable)

HybridRetriever (BM25 + dense + RRF) Β· CrossEncoderReranker Β· contextualize_chunks (Anthropic pattern) Β· CorpusIndex (bring- your-own-PDFs). 5 exports, used by the engine and the archived recipes.

archive/recipes/ β€” pre-engine reference recipes

research-assistant, trading-copilot, document-qa, rust-mcp-search-tool. All still work; all tests still pass. The research-assistant/production/main.py is a thin shim over engine.core.pipeline so the cookbook framing is preserved.

Domain presets

Six YAML files in engine/domains/:

presetwhen to use
generaldefault; anything
medicaldisease / treatment / drug / trial (PubMed / Cochrane / NEJM bias; no prescriptive advice)
papersacademic CS / ML / physics / biology (arXiv + Semantic Scholar + OpenReview)
financialSEC filings, earnings, company fundamentals (dates on every number)
stock_tradingtechnical + news per ticker β€” hard rule: never recommends buy/sell/hold
personal_docsQ&A over your own corpus, air-gapped (only corpus:// URLs allowed)

Write your own in ~10 lines of YAML β€” see docs/domains.md.

Bring your own documents

python scripts/index_corpus.py build ~/papers --out ~/papers.idx
export LOCAL_CORPUS_PATH=~/papers.idx
engine ask "what do my papers say about contextual retrieval?" --domain personal_docs

Supported formats: PDF (via pypdf), Markdown, plain text, HTML (via trafilatura). The index persists as a directory with a human-readable manifest.json + a pickled index.pkl. Rebuild anytime the docs change.

Details: docs/self-learning.md covers the trajectory + memory model; docs/plugins-skills.md covers external plugins.

MCP + Claude plugin

engine/mcp/server.py is a Python MCP server exposing:

  • research(question, domain?, memory?) β†’ structured {answer, verified_claims, unverified_claims, sources, trace, totals, memory_hits}
  • reset_memory()
  • memory_count()

Bundled Claude plugin at engine/mcp/claude_plugin/ β€” four skills (/research, /cite-sources, /verify-claim, /set-domain), ready to submit to the Anthropic marketplace.

Register in Claude Desktop:

// ~/Library/Application Support/Claude/claude_desktop_config.json
{
  "mcpServers": {
    "engine": {
      "command": "python",
      "args": ["-m", "engine.mcp.server"],
      "env": {
        "OPENAI_BASE_URL": "http://localhost:11434/v1",
        "OPENAI_API_KEY":  "ollama",
        "MODEL_SYNTHESIZER": "gemma3:4b",
        "SEARXNG_URL":    "http://localhost:8888"
      }
    }
  }
}

Plugin / skill loader

Install third-party Claude plugins or Hermes (agentskills.io) skills:

engine plugins install gh:owner/some-research-plugin@v1
engine plugins install file:./my-local-plugin
engine plugins install https://example.com/marketplace.json
engine plugins list
engine plugins uninstall some-plugin

Safety: every install runs a forbidden-symbols scan (eval(, exec(, os.system(, …) β€” rejects plugins that would execute arbitrary code. Registry lives at ~/.agentic-research/plugins/, fully inspectable, wipable.

Full docs: docs/plugins-skills.md.

Architecture at a glance

                β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
                β”‚   question  β”‚
                β””β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”˜
                       β–Ό
           β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”   T4.3 router  β€” route by question type
           β”‚  classify               β”‚
           β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                      β–Ό
           β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”   T1 decompose Β· T2 HyDE Β· T4.1 critic
           β”‚  plan                   β”‚   T4.5 refine-on-reject
           β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                      β–Ό
           β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”   SearXNG parallel Γ— N
           β”‚  search                 β”‚   + W5 local corpus (optional)
           β”‚  (+ T4.1 critic)        β”‚   + T4.1 coverage critic
           β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                      β–Ό
           β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”   T1 hybrid BM25 + dense + RRF
           β”‚  retrieve               β”‚   W4.1 cross-encoder rerank (opt-in)
           β”‚  (+ W4.1 rerank)        β”‚
           β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                      β–Ό
           β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”   W4.2 trafilatura clean-text
           β”‚  fetch_url              β”‚   skips corpus:// URLs
           β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                      β–Ό
           β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”   T4.4 LLM distillation
           β”‚  compress               β”‚   + W6.2 per-chunk char cap
           β”‚  (+ W6.2 cap)           β”‚
           β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                      β–Ό
           β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”   T2 synth Β· T4.2 FLARE on hedges
           β”‚  synthesize             β”‚   W6.1 three-case anti-hallucinate
           β”‚  (+ FLARE + stream)     β”‚   W7 streaming
           β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                      β–Ό
           β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”   T2 CoVe β€” decompose + verify
           β”‚  verify                 β”‚
           β””β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                    β”‚
              verified? ── yes ──▢ END
                    β”‚
                    no
                    β”‚
           ◀────── re-search unverified claims ──── loop (bounded by MAX_ITERATIONS)

Every stage has an ENABLE_* flag so you can leave-one-out ablate. Deep spec: docs/architecture.md.

Repo layout

agentic-research-engine-oss/
β”œβ”€β”€ engine/                        the flagship research engine
β”‚   β”œβ”€β”€ core/                      pipeline Β· models Β· trace Β· memory
β”‚   β”‚   β”œβ”€β”€ pipeline.py              Β· compaction Β· domains Β· plugins
β”‚   β”‚   β”œβ”€β”€ models.py
β”‚   β”‚   β”œβ”€β”€ trace.py
β”‚   β”‚   β”œβ”€β”€ memory.py
β”‚   β”‚   β”œβ”€β”€ compaction.py
β”‚   β”‚   β”œβ”€β”€ domains.py
β”‚   β”‚   └── plugins.py
β”‚   β”œβ”€β”€ interfaces/
β”‚   β”‚   β”œβ”€β”€ cli.py                 rich stdout CLI with subcommands
β”‚   β”‚   β”œβ”€β”€ tui.py                 Textual TUI
β”‚   β”‚   └── web/                   FastAPI + HTMX localhost GUI
β”‚   β”œβ”€β”€ mcp/
β”‚   β”‚   β”œβ”€β”€ server.py              Python FastMCP server
β”‚   β”‚   └── claude_plugin/         submittable Claude plugin bundle
β”‚   β”œβ”€β”€ domains/                   6 YAML presets
β”‚   β”œβ”€β”€ examples/                  5 worked research examples
β”‚   β”œβ”€β”€ benchmarks/                mini SimpleQA + BrowseComp fixtures + runner
β”‚   └── tests/                     pytest suite (all mocked, zero-network)
β”œβ”€β”€ core/rag/                      shared retrieval primitives (stable v1)
β”œβ”€β”€ archive/                       pre-engine recipes (kept for reference)
β”œβ”€β”€ tutorials/                     5 Google Colab notebooks
β”‚   β”œβ”€β”€ 01_engine_api_quickstart.ipynb
β”‚   β”œβ”€β”€ 02_groq_cloud_inference.ipynb
β”‚   β”œβ”€β”€ 03_build_your_own_corpus.ipynb
β”‚   β”œβ”€β”€ 04_mcp_server_from_python.ipynb
β”‚   └── 05_domain_presets_showcase.ipynb
β”œβ”€β”€ scripts/
β”‚   β”œβ”€β”€ searxng/                   self-hosted meta-search (docker-compose)
β”‚   β”œβ”€β”€ setup-local-mac.sh         Ollama + Docker + SearXNG one-liner
β”‚   β”œβ”€β”€ setup-vm-gpu.sh            Linux + vLLM/SGLang setup
β”‚   └── index_corpus.py            build a CorpusIndex from PDFs/md/txt
β”œβ”€β”€ docs/
β”‚   β”œβ”€β”€ architecture.md            deep technical spec
β”‚   β”œβ”€β”€ plugins-skills.md          write + install plugins
β”‚   β”œβ”€β”€ domains.md                 write a new preset
β”‚   β”œβ”€β”€ self-learning.md           trajectory logging + memory
β”‚   β”œβ”€β”€ progress.md                wave-by-wave build log
β”‚   β”œβ”€β”€ how-it-works.md            elevator pitches + SOTA comparison
β”‚   β”œβ”€β”€ launch-checklist.md        go-live sequence
β”‚   └── launch-copy.md             drafted HN / Reddit / Twitter copy
β”œβ”€β”€ .github/
β”‚   β”œβ”€β”€ workflows/
β”‚   β”‚   └── engine-tests.yml       CI: mocked suite on every PR
β”‚   β”œβ”€β”€ ISSUE_TEMPLATE/
β”‚   └── PULL_REQUEST_TEMPLATE.md
β”œβ”€β”€ CONTRIBUTING.md
β”œβ”€β”€ CHANGELOG.md
β”œβ”€β”€ CODE_OF_CONDUCT.md
β”œβ”€β”€ LICENSE                        MIT
└── README.md                      you're reading it

Configuration (env vars)

Full list in engine/core/pipeline.py header. Most-common knobs:

vardefaultpurpose
OPENAI_BASE_URLunset (cloud OpenAI)route to Ollama / vLLM / Groq / etc.
OPENAI_API_KEYollamasentinel for local; real key for cloud
MODEL_SYNTHESIZERgpt-5-minidrives small-model heuristic
TOP_K_EVIDENCEauto (5 for small, 8 for large models)retrieval budget
ENABLE_RERANK0opt-in; first run downloads bge-reranker-v2-m3 (~560 MB)
ENABLE_FETCH1trafilatura full-page fetch
ENABLE_STREAM1stream synthesis tokens to stdout
ENABLE_TRACE1per-call observability + summary at CLI end
LOCAL_CORPUS_PATHunsetset to an index dir to augment search with your docs
MEMORY_DB_PATH~/.agentic-research/memory.dbSQLite trajectory store

Full list: docs/architecture.md env-vars section.

Testing

cd engine && make test     # 120+ mocked tests in engine/tests/
# or repo-wide:
PYTHONPATH=$(pwd) .venv/bin/python -m pytest core/rag recipes engine/tests -q

All tests are mocked β€” no network, no API key, no model downloads. Live integration smokes are separate (make smoke).

CI runs on every push / PR touching engine / core / recipes β€” see .github/workflows/engine-tests.yml.

Troubleshooting

symptomlikely causefix
ModuleNotFoundError: No module named 'engine'PYTHONPATH missing the repo rootexport PYTHONPATH=$(pwd) from the repo root
CLI answer is empty + fastOllama not runningollama serve in another terminal, or ollama list to check
Connection refused on :8888SearXNG not upcd scripts/searxng && docker compose up -d
Connection refused on :11434Ollama not runningollama serve, or let the system service start it
First make smoke hangs ~20 s before outputModel warming up on first requestnormal; subsequent queries are faster
ENABLE_RERANK=1 stalls on first run560 MB bge-reranker downloadwait it out once; cached after
[corpus] LOAD BROKENcorrupt or wrong-version indexdelete + rebuild via scripts/index_corpus.py
TUI shows gibberish over SSHterminal too narrowresize to β‰₯ 100 cols; Textual needs space for the 3-pane layout
Web GUI shows Invalid memory modemalformed POSTuse the form UI; values validated against off/session/persistent
Streaming cuts off mid-answerflaky backendre-run; batched fallback kicks in on next attempt. Set ENABLE_STREAM=0 if it persists
zsh: command not found: twine (or similar) after uv pip install <pkg>uv's venv isn't auto-activated by your shelluse .venv/bin/<cmd> …, uv run <cmd> …, or source .venv/bin/activate before running
bad interpreter: .../python3: no such file or directory after moving or renaming the repo dirvenv shebangs are absolute paths tied to the dir the venv was created inrecreate: rm -rf .venv && uv venv && uv pip install -e . (or re-install whatever you had)
make test says 0 tests collectedwrong CWDrun from the engine/ dir or set PYTHONPATH
Claude Desktop doesn't see the pluginplugin.json in wrong path/plugin marketplace add <absolute-path-to>/engine/mcp/claude_plugin

Still stuck? Open an issue with the bug_report template β€” include ollama list, engine version, and the error.

Honest limits

  • Gemma 4B β‰  GPT-5.4 Pro. 15–25 % below 30 B+ open models on hard multi-hop. We position as "best $0 local", not "SOTA."
  • No LoRA fine-tuning in v1. Trajectory data is collected; actual model training deferred until GPU access + data volume.
  • No hosted SaaS. Local-first is the entire v1 positioning.
  • Team / multi-user features. Out of scope for v1.
  • General web crawler / own search index. Not shipping. SearXNG stays. A curated research-focused index may land in v2.
  • Mobile. Not in scope.

Status + roadmap

  • 0.1.0 β€” public alpha (current). Features listed above. See CHANGELOG.md.
  • 0.2 β€” specialist tool wiring (tools_enabled field in presets finally activates), first LoRA run if GPU arrives, plugin catalog in docs/.
  • 0.3 β€” team-collab features (shared memory, PR-driven domain presets), desktop app packaging via Tauri.
  • 0.4+ β€” per docs/progress.md "Open work" section.

Contributing

Good first issues: CONTRIBUTING.md. RFCs for anything pipeline-scope. Plugin + domain-preset submissions welcome.

No Co-Authored-By trailers; author-as-written-by.

License

MIT. See LICENSE.

MCP registry ownership

This PyPI package is the official source of the MCP server registered at https://registry.modelcontextprotocol.io. The line below is the ownership marker the registry validates β€” do not remove when editing this README.

mcp-name: io.github.TheAiSingularity/agentic-research

Keywords

research-agent

FAQs

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts