Skip to main content

AI-powered research, OSINT, verification and report synthesis CLI

Project description

๐Ÿ” SuperInfo - AI-Powered Research Tool

A production-grade, modular research platform combining:

  • ๐Ÿ”ฌ Research Agent โ€” web search + RAG + evidence-grounded answers
  • ๐Ÿ•ต๏ธ OSINT Agent โ€” public digital footprint analysis
  • โœ… Verification Agent โ€” claim fact-checking against authoritative sources
  • ๐Ÿ“„ Report Agent โ€” structured report synthesis

Available as both a CLI tool and FastAPI backend.


Architecture

User Input
    โ”‚
    โ–ผ
Intent / CLI / API
    โ”‚
    โ–ผ
Agent Router
    โ”‚
    โ”œโ”€โ–บ Search (Brave/Bing/SerpAPI)
    โ”‚       โ”‚
    โ”‚       โ–ผ
    โ”‚   Fetch & Clean HTML
    โ”‚       โ”‚
    โ”‚       โ–ผ
    โ”‚   Chunk + Embed (SentenceTransformers / Grok)
    โ”‚       โ”‚
    โ”‚       โ–ผ
    โ”‚   FAISS Vector Store โ—„โ”€โ”€โ”€โ”€ Persistent
    โ”‚       โ”‚
    โ”‚       โ–ผ
    โ”‚   Top-K Retrieval
    โ”‚       โ”‚
    โ”‚       โ–ผ
    โ”œโ”€โ–บ Grok LLM (reasoning + synthesis)
    โ”‚       โ”‚
    โ”‚       โ–ผ
    โ””โ”€โ–บ Structured Output
            โ”‚
            โ”œโ”€โ–บ PostgreSQL (history + reports)
            โ”œโ”€โ–บ Redis (cache + dedup)
            โ””โ”€โ–บ JSON / Markdown report

Quick Start

1. Install

git clone <repo>
cd superinfo
pip install -r requirements.txt

# Or install CLI globally
pip install -e .

2. Configure

cp .env.example .env
# Edit .env with your API keys:
# - GROK_API_KEY
# - SEARCH_API_KEY
# - DATABASE_URL (optional, for persistence)
# - REDIS_URL (optional, for caching)

3. Run CLI

# Research a topic
python superinfo.py research "What is retrieval-augmented generation?"

# Research with arXiv papers
python superinfo.py research "transformer architecture" --arxiv

# OSINT - username
python superinfo.py osint self --username johndoe

# OSINT - organization/domain
python superinfo.py osint org --domain openai.com

# Verify a claim
python superinfo.py verify "The Great Wall of China is visible from space"

# Generate report from saved outputs
python superinfo.py report --input research_output.json --title "My Report"

# Start API server
python superinfo.py serve --port 8000

4. Deploy with Docker

docker-compose up -d
# API available at http://localhost:8000
# Docs at http://localhost:8000/docs

API Reference

POST /research

{
  "question": "What is quantum computing?",
  "include_arxiv": false,
  "top_k": 5
}

POST /osint

{"username": "johndoe"}

POST /osint/domain

{"domain": "example.com"}

POST /verify

{"claim": "Coffee is the most consumed beverage in the world."}

POST /report

{
  "agent_outputs": [{...research output...}, {...verify output...}],
  "title": "Quarterly Research Report"
}

Tech Stack

Component Technology
API Framework FastAPI + Uvicorn
CLI Typer + Rich
LLM Grok API (OpenAI-compatible)
Embeddings SentenceTransformers / Grok
Vector Store FAISS (IndexFlatL2, persistent)
Search Brave / Bing / SerpAPI
Academic arXiv API
Database PostgreSQL (async SQLAlchemy)
Cache Redis
HTTP httpx (async)
HTML Parsing BeautifulSoup4 + readability-lxml
Validation Pydantic v2
Logging Loguru

Folder Structure

superinfo/
โ”œโ”€โ”€ app/
โ”‚   โ”œโ”€โ”€ agents/
โ”‚   โ”‚   โ”œโ”€โ”€ research.py       # Research agent
โ”‚   โ”‚   โ”œโ”€โ”€ osint.py          # OSINT agent
โ”‚   โ”‚   โ”œโ”€โ”€ verification.py   # Verification agent
โ”‚   โ”‚   โ””โ”€โ”€ report.py         # Report synthesis agent
โ”‚   โ”œโ”€โ”€ api/
โ”‚   โ”‚   โ”œโ”€โ”€ app.py            # FastAPI app + endpoints
โ”‚   โ”‚   โ””โ”€โ”€ schemas.py        # Pydantic request/response models
โ”‚   โ”œโ”€โ”€ cli/
โ”‚   โ”‚   โ””โ”€โ”€ main.py           # Typer CLI commands
โ”‚   โ”œโ”€โ”€ core/
โ”‚   โ”‚   โ”œโ”€โ”€ config.py         # Settings (pydantic-settings)
โ”‚   โ”‚   โ”œโ”€โ”€ llm.py            # Grok LLM client
โ”‚   โ”‚   โ”œโ”€โ”€ embeddings.py     # Embedding service
โ”‚   โ”‚   โ”œโ”€โ”€ rag.py            # RAG pipeline
โ”‚   โ”‚   โ””โ”€โ”€ logging.py        # Loguru setup
โ”‚   โ”œโ”€โ”€ db/
โ”‚   โ”‚   โ”œโ”€โ”€ models.py         # SQLAlchemy async models
โ”‚   โ”‚   โ”œโ”€โ”€ cache.py          # Redis cache layer
โ”‚   โ”‚   โ””โ”€โ”€ vector_store.py   # FAISS vector store
โ”‚   โ””โ”€โ”€ utils/
โ”‚       โ”œโ”€โ”€ text.py           # Chunking, cleaning, fetching
โ”‚       โ””โ”€โ”€ search.py         # Search abstraction (Brave/Bing/SerpAPI)
โ”œโ”€โ”€ tests/
โ”‚   โ””โ”€โ”€ test_core.py          # Unit tests
โ”œโ”€โ”€ superinfo.py              # Entry point
โ”œโ”€โ”€ requirements.txt
โ”œโ”€โ”€ pyproject.toml
โ”œโ”€โ”€ Dockerfile
โ”œโ”€โ”€ docker-compose.yml
โ””โ”€โ”€ .env.example

RAG Implementation

  • Chunk size: 1000 tokens (~4000 chars)
  • Overlap: 150 tokens (~600 chars)
  • Embedding: all-MiniLM-L6-v2 (384-dim) or Grok embeddings
  • Index: FAISS IndexFlatL2, persistent to disk
  • Retrieval: Top-k L2 similarity
  • LLM constraint: All answers grounded in retrieved chunks with [CHUNK-N] citations

Running Tests

pytest tests/ -v

Configuration Reference

Variable Default Description
GROK_API_KEY required Grok API key
GROK_BASE_URL https://api.x.ai/v1 Grok API base URL
GROK_CHAT_MODEL grok-beta Chat model name
EMBEDDING_BACKEND sentence_transformers grok or sentence_transformers
SEARCH_PROVIDER brave brave, bing, or serpapi
SEARCH_API_KEY required Search provider API key
DATABASE_URL postgres URL PostgreSQL connection string
REDIS_URL redis://localhost:6379/0 Redis URL
CHUNK_SIZE 1000 Tokens per chunk
CHUNK_OVERLAP 150 Overlap tokens
TOP_K 5 RAG retrieval count

Extending the System

Add a new agent:

  1. Create app/agents/my_agent.py with run() async method
  2. Add Pydantic schemas in app/api/schemas.py
  3. Register endpoint in app/api/app.py
  4. Add CLI command in app/cli/main.py

Add a search provider:

Add a new _search_<provider>() function in app/utils/search.py and register in search_web().


Constraints

  • โœ… No browser automation
  • โœ… No login scraping
  • โœ… Public HTTP GET only
  • โœ… No hidden endpoints
  • โœ… No inference beyond visible data

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

superinfo_tool-1.0.0.tar.gz (31.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

superinfo_tool-1.0.0-py3-none-any.whl (34.0 kB view details)

Uploaded Python 3

File details

Details for the file superinfo_tool-1.0.0.tar.gz.

File metadata

  • Download URL: superinfo_tool-1.0.0.tar.gz
  • Upload date:
  • Size: 31.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.0

File hashes

Hashes for superinfo_tool-1.0.0.tar.gz
Algorithm Hash digest
SHA256 324d7871e987cac6030e1cc1b5d36d259adaf14ccd4651e80d93f9682dc66a87
MD5 3c6d1107ea3d4ae38d53a5d76d413fc9
BLAKE2b-256 c89feb76c321f241d13b7378126ff030bf0207938a1941f4452729a1d05b360b

See more details on using hashes here.

File details

Details for the file superinfo_tool-1.0.0-py3-none-any.whl.

File metadata

  • Download URL: superinfo_tool-1.0.0-py3-none-any.whl
  • Upload date:
  • Size: 34.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.0

File hashes

Hashes for superinfo_tool-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 e19c5594e9e7330cb6ad2c54c005b40f9a02dd2baff944ed30eb689c48be412a
MD5 13f0cc063cf1de1adaaebf398816b907
BLAKE2b-256 4d6b98f3d290ee98d20ea38be56a6b58236ec21ab80d788ab495f383c17aaa6b

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page