post_cortex/lib.rs
1// Copyright (c) 2025, 2026 Julius ML
2// Licensed under the MIT License. See LICENSE at the workspace root.
3
4//! `post-cortex` — facade meta-crate.
5//!
6//! One dependency for the whole post-cortex stack. Re-exports the
7//! workspace member crates so callers can write
8//! `use post_cortex::{ConversationMemorySystem, SystemConfig};` or
9//! reach the canonical service trait via `post_cortex::PostCortexService`.
10//!
11//! ## Picking the right crate
12//!
13//! Direct dependence on a single member crate is usually preferable —
14//! it scopes the build to exactly what you need:
15//!
16//! | Goal | Crate |
17//! |------|-------|
18//! | Domain types, traits, error | [`post_cortex_core`] |
19//! | gRPC client (no server) | [`post_cortex_proto`] |
20//! | Custom storage backend | [`post_cortex_storage`] |
21//! | Embedding engine + HNSW | [`post_cortex_embeddings`] |
22//! | Full memory orchestrator | [`post_cortex_memory`] |
23//! | MCP tool functions | [`post_cortex_mcp`] |
24//! | Running daemon + `pcx` CLI | [`post_cortex_daemon`] |
25//!
26//! This facade is for **end-to-end consumers** (e.g. integration
27//! tests, sample apps) that want the entire surface without picking.
28
29#![forbid(unsafe_code)]
30#![deny(rustdoc::broken_intra_doc_links)]
31
32// Core domain — types, error, graph/session/workspace/summary helpers,
33// the `core::*` cross-cutting primitives, and the canonical
34// `PostCortexService` trait.
35pub use post_cortex_core::*;
36
37// Storage backends (RocksDB + optional SurrealDB). Re-exported under
38// `post_cortex::storage::*`.
39pub use post_cortex_storage as storage;
40
41// Embedding engines + HNSW vector database.
42pub use post_cortex_embeddings as embeddings;
43
44// Memory orchestrator: `ConversationMemorySystem`, `SystemConfig`,
45// `MemoryServiceImpl`, the non-blocking write `Pipeline`.
46pub use post_cortex_memory::{
47 ConversationMemorySystem, MemoryServiceImpl, Pipeline, PipelineConfig, PipelineError,
48 SystemConfig,
49};
50
51/// MCP tool functions. Re-exported under `post_cortex::mcp` so
52/// downstream callers writing custom MCP servers can embed them.
53pub mod mcp {
54 pub use post_cortex_mcp::*;
55}
56
57/// `tools::mcp::*` historical path — preserved as a convenience for
58/// existing code; new callers should use [`mcp`] directly.
59pub mod tools {
60 pub use post_cortex_mcp as mcp;
61}
62
63/// Daemon runtime (axum + tonic + rmcp + SSE). Pulled in transitively
64/// by depending on this crate; reach individual pieces under
65/// `post_cortex::daemon::*`. The `pcx` CLI binary is shipped by
66/// `post-cortex-daemon` directly via its `[[bin]]` entry — depend on
67/// that crate (not this facade) if you only want to run the daemon.
68pub use post_cortex_daemon::daemon;
69
70/// Re-export the proto wire types under `post_cortex::proto`.
71pub use post_cortex_core::proto;