Skip to main content

ijima_core/
lib.rs

1// Copyright (C) 2026 Industrial Algebra
2// SPDX-License-Identifier: Apache-2.0
3
4//! # ijima-core
5//!
6//! Core schema, stores, error types, and API contract for the
7//! [Ijima](https://github.com/Industrial-Algebra/Ijima) centralized
8//! agentic memory backend.
9//!
10//! Ijima is the single source of truth for agentic memory across the IA
11//! ecosystem. This crate holds the type-level contract every other Ijima
12//! crate and every harness adapter speaks: the memory palace model, the
13//! knowledge graph, the session context repository, and the unified error
14//! type.
15//!
16//! The store implementations (SQLite + vector index), the HTTP server,
17//! the mining engine, and the harness client live in their own crates
18//! (`ijima-server`, `ijima-miner`, `ijima-client`). This crate deliberately
19//! stays transport- and backend-free so the contract can be shared without
20//! pulling in heavy I/O dependencies.
21//!
22//! ## Features
23//!
24//! - `std` (default): Standard library support. Without it, only the
25//!   pure type definitions compile.
26//!
27//! - `embeddings`: pure `Embedder` trait + `Embedding` vector type. The
28//!   default dimension is 384 to match pi-mempalace's `all-MiniLM-L6-v2`
29//!   for migration parity.
30//! - `serde`: Serialize/Deserialize impls for all domain types. Required
31//!   by the store backends and the HTTP API.
32//! - `store`: the pure async `Store` trait every backend implements.
33//!
34//! ## Status
35//!
36//! Scaffolded — the API surface is being filled in test-first. See
37//! `docs/HANDOFF.md` and `docs/DESIGN.md` at the repository root.
38
39#![forbid(unsafe_code)]
40#![warn(missing_docs)]
41
42pub mod capabilities;
43pub mod diary;
44pub mod embeddings;
45pub mod error;
46pub mod harness;
47pub mod knowledge;
48pub mod memory;
49pub mod mining;
50pub mod namespace;
51pub mod palace;
52pub mod provenance;
53pub mod repo;
54pub mod session;
55pub mod store;
56
57pub use capabilities::intersection_number;
58pub use diary::DiaryEntry;
59pub use embeddings::{DEFAULT_EMBEDDING_DIM, Embedder, Embedding};
60pub use error::IjimaError;
61pub use knowledge::{Entity, EntityId, EntityRecord, KgStats, KnowledgeGraph, Triple};
62pub use memory::{Memory, MemoryId, MemorySource};
63pub use mining::{AcceptedExtraction, QueuedExtraction};
64pub use namespace::{Namespace, NamespaceId, NamespaceKind};
65pub use palace::{PalaceGraph, ProjectTaxon, Room, Tunnel, TunnelTraversal};
66pub use provenance::{AuthorityScope, InstanceId};
67pub use repo::RepoDirectory;
68pub use session::{Session, SessionId, SessionTurn, TurnRole};
69pub use store::{NamespaceCount, SearchHit, Store, StoreStats};
70
71/// Convenience `Result` alias used throughout the Ijima crates.
72pub type Result<T, E = IjimaError> = core::result::Result<T, E>;