Skip to main content

Local-first research framework for evidence-grounded idea generation.

Project description

Principia V1.3

Principia V1.3 is a local-first Python framework for research search, paper feature extraction, evidence-grounded idea generation, and prior-idea comparison.

The import package is principia. The initial PyPI distribution name is principia-ai because the principia distribution name is currently occupied on PyPI. If that ownership issue is resolved later, the import API remains unchanged.

Install

pip install principia-ai

For notebooks:

pip install principia-ai ipykernel
python -m ipykernel install --user --name principia-v13-python --display-name "Python 3.12 (Principia V1.3)"

Quickstart

import principia as pc

API_key = "sk-your-key-here"
goal = "provide real-time, calibrated, actionable process quality control for autonomous coding agents operating on large-scale repositories"

ws = pc.Workspace(
    "./principia_project",
    llm_config=pc.siliconflow_config(API_key, timeout=420, max_retries=2),
)

works = ws.research.search(goal, target_count=50)
features = ws.research.extract(
    works[:20],
    model="siliconflow:deepseek-ai/DeepSeek-V4-Pro",
    overwrite=False,
)
selected_evidence = pc.select_evidence(features)
idea = ws.ideas.generate(
    selected_evidence,
    user_note=goal,
    mode="calculus",
    model="siliconflow:Qwen/Qwen3.5-397B-A17B",
)
comparison = ws.ideas.compare(idea, features, model="siliconflow:Qwen/Qwen3.5-397B-A17B")

export_path = ws.export(
    goal=goal,
    works=works,
    features=features,
    idea=idea,
    comparison=comparison,
)

Continue From Existing Features

If research and extraction already finished in an earlier notebook, reopen the same workspace and load persisted features:

import principia as pc

API_key = "sk-your-key-here"
goal = "your research goal"

ws = pc.Workspace("./principia_project", llm_config=pc.siliconflow_config(API_key))
features = ws.load_features()
selected_evidence = pc.select_evidence(features)

idea = ws.ideas.generate(
    selected_evidence,
    user_note=goal,
    mode="calculus",
    model="siliconflow:Qwen/Qwen3.5-397B-A17B",
)

This does not rerun public search or LLM extraction.

What Principia Provides

  • Hybrid research search over OpenAlex, Crossref, and arXiv.
  • DOI/arXiv/OpenAlex/title deduplication with peer-reviewed venue promotion.
  • Structured extraction of ideas, principles, baselines, benchmarks, takeaways, and result facts.
  • Evidence selection through pc.select_evidence(...).
  • Idea generation modes: standard, calculus, and scidialect_evo.
  • Generation modes are internal strategies, not evidence; generated source_evidence is grounded to selected work/feature IDs.
  • Prior-idea comparison using lexical shortlisting plus the configured LLM.
  • Notebook and terminal progress with ETA, heartbeat updates during long LLM calls, cancellation, and resume-by-cache behavior.
  • Local SQLite storage with visible user-facing exports.

Workspace Layout

Principia creates visible files under the workspace root:

principia_project/
  README.md
  principia_outputs/
    latest/
      idea.md
      result.json
      works.json
    exports/
      <idea_id>/
        idea.md
        result.json
        works.json
  .principia/
    principia.sqlite
    artifacts/
      source_json/
      exports/
      pdfs/
      cache/

The .principia/ folder stores internal SQLite state, cache data, and canonical artifacts. The visible principia_outputs/ folder mirrors the latest readable outputs for inspection.

Inspect and compact storage:

ws.storage_report()
ws.compact()

ws.compact() checkpoints and vacuums SQLite without deleting works, features, ideas, or exports. Optional cleanup knobs such as keep_source_json=1 and remove_cache=True only remove regenerable artifacts.

Tutorial And Docs

The official tutorial contains no real API key and no executed outputs. Replace YOUR_SILICONFLOW_API_KEY at runtime in your own local copy.

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

principia_ai-1.3.2.tar.gz (54.5 kB view details)

Uploaded Source

Built Distribution

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

principia_ai-1.3.2-py3-none-any.whl (46.7 kB view details)

Uploaded Python 3

File details

Details for the file principia_ai-1.3.2.tar.gz.

File metadata

  • Download URL: principia_ai-1.3.2.tar.gz
  • Upload date:
  • Size: 54.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.7

File hashes

Hashes for principia_ai-1.3.2.tar.gz
Algorithm Hash digest
SHA256 8adeaf4a4a4ddc746e6c0005f697068a8fd0649c97039a6f855a1ebefac2e504
MD5 ef29f1fcee8b6ae9498d022e79d2502c
BLAKE2b-256 5bd88a6a8e4fed1ed60871c36c6ed25cafc8ef414eec1894be8c7f3841485c69

See more details on using hashes here.

File details

Details for the file principia_ai-1.3.2-py3-none-any.whl.

File metadata

  • Download URL: principia_ai-1.3.2-py3-none-any.whl
  • Upload date:
  • Size: 46.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.7

File hashes

Hashes for principia_ai-1.3.2-py3-none-any.whl
Algorithm Hash digest
SHA256 36c36579a657f04baaf4611adfe70cab025017c26a352d26c3d1d88e129ba369
MD5 4c5f933f8fa8826eb7d67bdb89e839c1
BLAKE2b-256 bcb653606a4ef8f6ba0083364e3197b6aba36c94aeebacf601b7bede90ed60db

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