Skip to content

Architecture Overview

Source mirrored from seocho/docs/ARCHITECTURE.md

SEOCHO turns unstructured data into ontology-aligned graph memory. This page is the public architecture overview: it explains the product boundary, the main planes, and where to go for deeper implementation detail.

Do not start here if you only want a first run. Use /docs/quickstart/ or /docs/runtime_deployment/ first.

If you need…Read this page until…Then read
the product shapeArchitecture In One PageWhy SEOCHO
the runtime internalsRuntime BoundaryRuntime Architecture
query and Graph-RAG internalsQuery BoundaryQuery Architecture
module ownershipModule OwnershipModule Ownership Map
maintainer migration notesRead NextMaintainer Architecture Notes

Most users can stop after the first three sections.

SEOCHO has one public shape: a Python SDK plus an optional runtime service. Internally, it is split into planes so graph behavior stays reviewable.

PlaneOwnsMain paths
Public facadestable user calls such as Seocho.add(), Seocho.ask(), Seocho.local(), Seocho.remote()src/seocho/client.py, src/seocho/session.py
Ontology planeschema contract, context hash, JSON-LD, offline governancesrc/seocho/ontology*.py
Indexing planedocument ingest, extraction, linking, rule assessment, graph writessrc/seocho/index/, src/seocho/rules.py
Query planeintent, retrieval, Cypher validation, evidence, answer synthesissrc/seocho/query/
Runtime shellHTTP routes, policy, readiness, workspace/database scoperuntime/
Compatibility shelllegacy imports and batch compatibility while migration continuesextraction/

The invariant is simple:

ontology
-> indexing prompt
-> graph write metadata
-> query intent and evidence
-> trace
-> supported answer

If that ontology context is lost, the system may still answer, but the answer is not auditable in the way SEOCHO promises.

Documents or records
-> ontology-shaped extraction
-> graph facts with provenance
-> semantic query planning
-> graph evidence
-> grounded answer

The default path is not “run every agent.” It is:

  1. ingest data against one ontology contract
  2. write graph facts with provenance
  3. resolve a question through the semantic layer
  4. return an answer with evidence and trace metadata

Parallel debate is an advanced mode for explicit multi-graph comparison.

The runtime shell exposes the same graph contract over HTTP. It owns deployment concerns, not canonical engine logic.

Runtime concernOwner
route wiring and request validationruntime/agent_server.py
shared service compositionruntime/server_runtime.py
memory/search facaderuntime/memory_service.py
raw runtime ingestionruntime/runtime_ingest.py
request policyruntime/policy.py
readiness and graph-agent stateruntime/agent_readiness.py
request ID propagationruntime/middleware.py

extraction-service still exists as the local compose service name, but the long-term package owner is runtime/. Compatibility aliases in extraction/* keep older imports working while canonical runtime code moves into runtime/.

The supported local stack is intentionally small:

  • neo4j
  • extraction-service
  • evaluation-interface

Use /docs/runtime_architecture/ when changing runtime internals. Use /docs/runtime_deployment/ when you only need to run the service.

The query plane turns a user question into graph-grounded evidence and a supported answer.

Query stepOwner
intent and answerabilitysrc/seocho/query/intent.py and related contracts
strategy selectionsrc/seocho/query/strategy_chooser.py
Cypher validationsrc/seocho/query/cypher_validator.py
constraints and run metadatasrc/seocho/query/constraints.py, src/seocho/query/run_registry.py
semantic specialists and routingsrc/seocho/query/semantic_agents.py
shared orchestrationsrc/seocho/query/semantic_flow.py

Rule of thumb: add query behavior under src/seocho/query/. Keep extraction/* focused on compatibility, transport, and runtime injection.

For details, read /docs/query_architecture/.

SEOCHO keeps generated artifacts visible so users and maintainers can inspect the system instead of treating it as a black box.

ArtifactUsual locationWhy it matters
ontology contractschema.jsonld or a Python Ontologydefines the graph contract
graph statedata/neo4j/ for the local compose stackshows persisted graph facts
semantic artifactsoutputs/semantic_artifacts/stores approved/draft semantic context
rule profile registryoutputs/rule_profiles/rule_profiles.dbrecords validation and promotion state
semantic run metadataoutputs/semantic_metadata/explains query behavior after the run
tracesSEOCHO_TRACE_JSONL_PATHpreserves execution evidence

Use /docs/files_and_artifacts/ for concrete inspection commands.

Use this table before editing code.

Change areaStart inAlso check
public SDK callssrc/seocho/client.py, src/seocho/session.pyREADME and Python SDK docs
ontology behaviorsrc/seocho/ontology*.pyontology docs and governance rules
indexing or graph shapingsrc/seocho/index/, src/seocho/rules.pyexamples and ingestion tests
query, retrieval, answeringsrc/seocho/query//docs/query_architecture/ and Graph-RAG contracts
runtime routes or policyruntime/runtime compatibility tests
legacy compatibilityextraction/migration notes and alias tests
website/docs publishingdocs/, website/, tteon.github.io mirrordocs sync contract

If a change crosses more than one row, explain the ownership boundary in the PR.

Mocks are useful for contracts and no-service CI. They are not evidence for throughput, latency, scalability, production readiness, or external-system compatibility.

Performance or production claims need a live run against every named service. The report should include:

  • service versions
  • dataset
  • concurrency
  • hardware or container limits
  • warmup
  • skipped components
  • exact commands

If a live gate is unavailable, report the gap. Do not replace it with a mock number.

NeedDocument
run the local serviceRuntime Deployment
understand runtime internalsRuntime Architecture
understand query and Graph-RAG internalsQuery Architecture
find generated filesFiles and Artifacts
contribute safelyOpen Source Playbook
inspect internal migration notesMaintainer Architecture Notes
see detailed ownershipModule Ownership Map